Pointers in C Language with Examples: quick revision, 15 bites
All 15 revision bites from this kit, free and with no sign-up.
A Pointer Stores an Address, Not a Value
Pointers point — they don't hold the value.
A pointer is a variable whose value is the **memory address** of another variable. It lets you access that variable indirectly.
Takeaway. Pointer = address holder; * reads/writes the value at that address.
Declaring and Initializing a Pointer
Star declares, ampersand assigns.
Takeaway. Use `type *name = &variable;` to declare and point in one line.
Full Working Example: Read and Modify via Pointer
Change x without touching x.
Writing `*p = 20` changes the value at the address p holds — which is x itself.
Takeaway. Dereferencing on the left side of `=` writes to the original variable.
Variable vs Pointer: What's Stored
Value vs address — know the difference.
Takeaway. A variable holds data; a pointer holds where the data lives.
How Dereferencing Works Step-by-Step
Follow the arrow to the value.
Takeaway. Dereferencing follows the stored address to reach the original variable.
Uninitialized Pointers Are Dangerous
Wild pointers crash programs.
Takeaway. Never dereference a pointer that doesn't point to valid memory.
Don't Confuse `*p = &x` with `p = &x`
One star changes everything.
Takeaway. Assign addresses to the pointer itself (no star); use star only to reach the value.
Why C Uses Pointers: Swap Two Numbers
Swap without return values.
Passing addresses lets a function modify the caller's variables directly.
Takeaway. Pointers enable functions to modify caller data — a key C pattern.
Pointer Size Is Fixed per Platform
All pointers are the same size.
On a 64-bit system, every pointer (int*, char*, float*) is typically **8 bytes**; on 32-bit systems, **4 bytes** — regardless of the type it points to.
Takeaway. Pointer size depends on the architecture, not the pointed-to type.
Pointers and Arrays Are Closely Linked
An array name is basically an address.
`arr[i]` is equivalent to `*(arr + i)` — array indexing is pointer arithmetic in disguise.
Takeaway. Array name decays to a pointer to its first element.
Pointer Arithmetic: Move by Type Size
p+1 doesn't mean +1 byte.
Takeaway. Pointer arithmetic scales by the size of the pointed-to type.
NULL vs Dangling Pointers
Two ways pointers go bad.
Takeaway. Check for NULL; never use a pointer after its target is freed.
Exam Favorite: Output of Pointer Code
Trace addresses, not just values.
Takeaway. Most pointer exam questions test whether you can trace address vs value.
Remember: & = 'Address Of', * = 'Value At'
Ampersand asks, star answers.
`&` = **A**ddress **O**f (A&O). `*` = **V**alue **A**t (VA). Say it aloud: 'A&O gives the address, VA gives the value.'
Takeaway. & gets the address; * gets the value at that address.
Always Initialize and Check Pointers
Safe pointers save hours of debugging.
Takeaway. Disciplined initialization prevents most pointer bugs.
Your notes can be a kit like these
Every kit here was made from real study material. Point Veda at a chapter, a PDF, a photo or a link and get notes, flashcards, practice MCQs, games and a scored test — free, in 42 languages.
- Chapter notes
- Flashcards
- Practice MCQs
- Scored tests
- Exam prep
Get Veda free See what students get
Free to start · No ads · Works in 42 languages