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 8690283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:52:11+00:00 2026-06-12T23:52:11+00:00

If I have some array of ints, let’s just say: int iarr[5] = {0,

  • 0

If I have some array of ints, let’s just say:

int iarr[5] = {0, 7, 3, 12, 99};

Which is present at address 0xbfdf53a8; and I want to print out the values of this with a loop, I can do something like this:

for(i=0; i<5; i++)
   printf("value of iarr[%d] = %d\n", i, *(iarr+i));

This loop works because we’re incrementing by one “int” each time (the address is bumped by 4 bytes each iteration on a typical 32-bit machine).

My question is, when is the type specified byte offset applied? Is that part of the compile process (meaning it’s in the assembly somewhere), or is that done at the OS level?

I would assume how this is handled in a standardized manner, but I haven’t been able to find that answer yet.

  • 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-06-12T23:52:13+00:00Added an answer on June 12, 2026 at 11:52 pm

    It’s part of the compilation process, the compiler generates code that takes the size of the operands into account.

    Note that you can increment and do arithmetic with a pointer to a 5412-byte struct just as easily as a pointer to a 4-byte int. The compiler inspects the type of the pointer expression and generates the proper code.

    The operating system is not involved at all in these low-level details, it’s just code in the process from it’s perspective.

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

Sidebar

Related Questions

Let's say I have a function called MyFunction(int myArray[][]) that does some array manipulations.
Suppose I have some pointer, which I want to reinterpret as static dimension array
I have some Thread count pCount and I have some float[] array. I want
I have some code which builds an array of date ranges. I then call
Let's say I have the array 1,2,3,4,5,6,7,8,9,10,11,12 if my chunck size = 4 then
Let's say I have an array of floating point numbers, in sorted (let's say
Let's say I have the following method: public static int CountNonNullMembers<T>(this IEnumerable<T> enumerable) {
I have some array data returned from an ajax call consisting of an image
I have some troubles mapping a JSON Array to RestKit. This is what the
I have some checkboxes bound to an array in my model. This works great,

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.