Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7171917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:30:34+00:00 2026-05-28T15:30:34+00:00

Here’s the deal. I have a large character array and am trying to manipulate

  • 0

Here’s the deal. I have a large character array and am trying to manipulate it. Here’s some code I was using to test the idea:

#include <stdio.h>

char r[65536],*e=r;

main() {
    e+=8;
    while(*e) {
        *e+=1;
        e+=5;
        *e-=1;
        e-=1;
    }
    *e+=1;
    printf("%i",*e);
    printf(" %c",e);
}

What it’s supposed to do is:

  1. Set the first element to 8
  2. Then, while the current element is not zero,
    1. Move to the next cell
    2. Add 5 to it
    3. Move back
    4. Subtract one. (This repeats 8 times because the while test will fail when it has subtracted the last one)
  3. Display the location of the pointer
  4. Display the contents of the array that the pointer points to (I hope)

What it does:

1 Φ

as opposed to

40 (   

^^ 8 x 5 = 40, so that’s what it should display.

Any tips/suggestions/criticism accepted.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:30:35+00:00Added an answer on May 28, 2026 at 3:30 pm

    You’re dereferencing exactly where you should not and vice versa. What you meant to do was:

    *e+=8;
    while(*e) {
        e+=1;
        *e+=5;
        e-=1;
        *e-=1;
    }
    *e+=1;
    printf("%d",e - r); //index
    printf(" %p",e); //pointer value      
    printf(" %c",*e); //pointee value
    

    * retrieves the value the pointer points to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the code in a function I'm trying to revise. This example works
Here is the issue I am having: I have a large query that needs
here is my php code $titikPetaInti = array(); while($row = mysql_fetch_assoc($hasil2)) { $titikPetaInti[] =
Here is the problem that I am trying to solve. I have two folders
Here is the code I'm using inside my AsyncTask DefaultHttpClient httpClient = new DefaultHttpClient();
Here is the problem I'm trying to solve for my game. I have this
Here's the code I have. It works. The only problem is that the first
Here's my code: // Not all headers are relevant to the code snippet. #include
Here is the code from my project where I am using a datepicker. The
Here is what I am trying to achieve in PHP: I have this string:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.