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 issue I am having: I have a large query that needs
Here is my code...I have two dimensional matrices A,B. I want to develop the
Here is my code (Say we have a single button on the page that
Here is what I am trying to achieve in PHP: I have this string:
Here's my code: // Not all headers are relevant to the code snippet. #include
Here is some code I made :) @echo off set source=R:\Contracts\ set destination=R:\Contracts\Sites\ ROBOCOPY
Here is an example: I have a file 1.js, which has some functions. I
Here is my situation: I am using telerik with winform. I have a dataset
Here is some code on the javascript side for form-based uploads: iframe.setAttribute('src', 'javascript:false;'); I'm
Here is my code. @@inversions = 0 numbers = [very big array] def merge_sort(array)

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.