Pointers are the core of C. This is where you truly understand how computers work. From simple memory addresses to complex data structures, pointers unlock C's power and its pitfalls.
A variable that stores a memory address. The * dereferences, the & gets the address.
int* ptr1, ptr2; declares ptr1 as a pointer, but ptr2 as a regular integer!
int *ptr1, *ptr2;
Moving through memory. Pointers move by the size of the type they point to.
Arrays decay into pointers, but they are not identical.
A pointer that stores the address of another pointer. Used for changing pointer targets.
Can point to any type, but cannot be dereferenced without casting.
Protecting data integrity.
Storing code addresses. Enables callbacks.
Why your C program segfaults.