I believe I understand how normal variables and pointers are represented in memory if you are using C.
For example, it\'s easy to understand that a pointer Ptr will
A C array is just a block of memory that has sequential values of the same size. When you call malloc(), it is just granting you a block of memory. foo[5] is the same as *(foo + 5).
Example - foo.c:
#include
int main(void)
{
int foo[5];
printf("&foo[0]: %tx\n", &foo[0]);
printf("foo: %tx\n\n", foo);
printf("&foo[3]: %tx\n", &foo[3]);
printf("foo: %tx\n", foo + 3);
}
Output:
$ ./foo
&foo[0]: 5fbff5a4
foo: 5fbff5a4
&foo[3]: 5fbff5b0
foo: 5fbff5b0