how array addressing and pointer arithmetic are linked
#include <stdio.h>
#define ARRAY_SIZE 10
int main()
{
char array[ARRAY_SIZE] = "123456789";
int index; /* Index into the array */
for (index = 0; index < ARRAY_SIZE; ++index) {
printf("&array[index]=0x%p (array+index)=0x%p array[index]=0x%x\n",
&array[index], (array+index), array[index]);
}
return (0);
}
Related examples in the same category