The Little Book of Pointers

Click the thumbnails above to see a larger image.

The fastest, easiest way to master pointers in C.

Pointers are essential in C – but learning how to use them correctly can be hard work. The Little Book Of Pointers comes to the rescue. This is a book for intermediate to advanced-level C programmers. It explains pointers from the ground up. What exactly is a pointer variable and how does it work with addresses in memory? What is indirection? How can you use multiple indirection? What is an array identifier – a pointer or an address? How can you avoid common pointer problems such as memory leaks and program crashes? What is the correct and safe way to allocate memory? What is data type alignment and why does the field order of a struct change the amount of memory it requires? How do you do pointer arithmetic? How can you create singly and doubly linked lists? What is the difference between a stack and a queue and how can you manipulate them using pointers? How can you create function pointers – or even arrays of function pointers? 

This book explains …

  • Pointer variables
  • Dereferencing pointers
  • Multiple Indirection
  • Arrays, strings and addresses
  • Pointer Arithmetic
  • Generic pointers
  • Pointers to structs
  • Data Alignment
  • Memory Allocation
  • Linked Lists
  • Stacks
  • Queues
  • Function Pointers
  • Deep & Shallow Copies
  • Common Pointer Problems

Click the thumbnails above to see a larger image.

Table of contents

Introduction

1 – Introduction to Pointers
2 – Addresses and Arrays
3 – Indirection
4 – Allocating Memory
5 – Pointer Arithmetic
6 – Pointers to Structs
7 – Lists and Data Structures
8 – Queues and Stacks
9 – Function Pointers
10 – Common Pointer Problems

Appendix​