In below C code using this online compiler, when I increase the pointer address by one, the actual address increases by four. It is because the data type is int.
#include <stdio.h>
int main()
{
int my_array[3] = {0, 1, 2};
int* p_array = my_array;
printf("%p \n", p_array);
p_array = ++p_array;
printf("%p \n", p_array);
return 0;
}
Output after compilation:
0x7ffeb9ba5814
0x7ffeb9ba5818
I have two questions:
Is it possible to directly access/point to the single byte at the address 0x7ffeb9ba5815 using pointer? (not by using bitwise operations)
How come the addresses pointers hold in the above case are 6-byte such as 0x7ffeb9ba5818? (I though addresses are either 4 or 8 bytes)