Pointers and memory
Addresses, pointer arithmetic, where objects live, and the malloc and free rules that keep a program alive.
Addresses and indirection
A pointer holds an address. The two operators are & (address of) and * (dereference, the value at that address). The type of a pointer tells the compiler how far one step moves and how to read the bytes it finds.
int n = 42;
int *p = &n; /* p points at n */
*p = 43; /* writes through the pointer: n is now 43 */
int a[4] = { 10, 20, 30, 40 };
int *q = a; /* an array name decays to a pointer to its first element */
q[2] == *(q + 2) /* 30: subscripting is addition plus a dereference */
&a[2] == a + 2 /* the same address, two spellings */
char s[] = "hello"; /* 6 bytes: 5 letters plus a terminating '