1. Introduction
- Pointers and Memory
- The Concept of Null
- Pointer Size and Types
- Predefined Pointer-Related Types
- Pointer Operators
- Pointer Arithmetic
- Comparing Pointers
- Common Uses of Pointers
- Constants and Pointers
- Summary
- Dynamic Memory Allocation
- Dynamic Memory Allocation Functions
- Deallocating Memory Using the free Function
- Dangling Pointers
- Quick Review of Arrays
- Pointer Notation and Arrays
- Using malloc to Create a One-Dimensional Array
- Using the realloc Function to Resize an Array
- Passing a One-Dimensional Array
- Using a One-Dimensional Array of Pointers
- Pointers and Multidimensional Arrays
- Passing a Multidimensional Array
- Dynamically Allocating a Two-Dimensional Array
- Jagged Arrays and Pointers
- Summary
- String Fundamentals
- Standard String Operations
- Passing Strings
- Returning Strings
- Function Pointers and Strings
- Summary
- Introduction
- Structure Deallocation Issues
- Avoiding malloc/free Overhead
- Using Pointers to Support Data Structures
- Summary 158
- Pointer Declaration and Initialization
- Improper Pointer Declaration
- Failure to Initialize a Pointer Before It Is Used
- Dealing with Uninitialized Pointers
- Pointer Usage Issues
- Test for NULL
- Misuse of the Dereference Operator
- Dangling Pointers
- Accessing Memory Outside the Bounds of an Array
- Calculating the Array Size Incorrectly
- Misusing the sizeof Operator
- Always Match Pointer Types
- Bounded Pointers
- String Security Issues
- Pointer Arithmetic and Structures
- Function Pointer Issues
- Memory Deallocation Issues
- Double Free
- Clearing Sensitive Data
- Using Static Analysis Tools
- Summary
- Casting Pointers
- Accessing a Special Purpose Address
- Accessing a Port
- Accessing Memory using DMA
- Determining the Endianness of a Machine
- Aliasing, Strict Aliasing, and the restrict Keyword
- Using a Union to Represent a Value in Multiple Ways
- Strict Aliasing
- Using the restrict Keyword
- Threads and Pointers
- Sharing Pointers Between Threads
- Using Function Pointers to Support Callbacks
- Object-Oriented Techniques
- Creating and Using an Opaque Pointer
- Polymorphism in C
- Summary