← C Programming learning path
C Programming · Module 7 of 10

Pointers

A pointer stores a memory address; it is the most powerful idea in C.

📖 Key ideas

  1. Every variable lives at a memory address; &x gives that address.
  2. int *p = &x; makes p point to x.
  3. *p reads or changes the value p points to (dereferencing).
  4. Pointers let functions change caller variables and work with arrays.
  5. NULL means "points to nothing"; check before using.
💡 Real-life example: A pointer is a house address written on paper: with it you can visit and change what is inside the house.
&xAddress of x
*pValue at the address in p
NULLPointer to nothing
DereferenceAccess the value a pointer points to