Return to Understanding and Using C Pointers
in pointer declaration, Declaring Pointers, Pointer Operators, Misuse of the Dereference Operator–Misuse of the Dereference Operator
initialization operator, Using malloc with static and global pointers
in pointer to function declarations, Pointers to Functions, Declaring Function Pointers
as overloaded, To NULL or not to NULL
Address Space Layout Randomization (ASLR), Security Issues and the Improper Use of Pointers
aliasing, Dangling Pointer Examples, Copying Strings, Aliasing, Strict Aliasing, and the restrict Keyword–Using the restrict Keyword
alloca function, The alloca Function and Variable Length Arrays
ampersand (&), address of operator, Address of Operator, Pointer Notation and Arrays
arithmetic operators, Pointer Operators, Pointer Arithmetic–Subtracting two pointers
arrays, Pointers and Arrays–Multidimensional Arrays
accessing memory outside of, Accessing Memory Outside the Bounds of an Array–Accessing Memory Outside the Bounds of an Array
array notation for, Pointer Notation and Arrays–Pointer Notation and Arrays, Using malloc to Create a One-Dimensional Array, Using Array Notation–Using Pointer Notation, Pointers and Multidimensional Arrays, Passing a Multidimensional Array
of characters, strings declared as, String Declaration
compared to pointers, Pointers and Arrays, Quick Review of Arrays
compared to pointers to arrays, Differences Between Arrays and Pointers
declaration of, One-Dimensional Arrays–Multidimensional Arrays
of function pointers, Using an Array of Function Pointers–Using an Array of Function Pointers
initialization of, One-Dimensional Arrays, Two-Dimensional Arrays, Multidimensional Arrays
jagged, Jagged Arrays and Pointers–Jagged Arrays and Pointers
multidimensional, Multidimensional Arrays
passing to functions, Passing a Multidimensional Array–Passing a Multidimensional Array
pointers to, Pointers and Multidimensional Arrays–Pointers and Multidimensional Arrays
one-dimensional, One-Dimensional Arrays–One-Dimensional Arrays, Using malloc to Create a One-Dimensional Array, Using a One-Dimensional Array of Pointers–Using a One-Dimensional Array of Pointers
passing to functions, Passing a One-Dimensional Array–Using Pointer Notation
pointer notation for, Pointer Notation and Arrays–Pointer Notation and Arrays, Using malloc to Create a One-Dimensional Array, Using Pointer Notation–Using Pointer Notation, Using a One-Dimensional Array of Pointers, Pointers and Multidimensional Arrays, Passing a Multidimensional Array
of pointers, Using a One-Dimensional Array of Pointers–Using a One-Dimensional Array of Pointers
pointers to, Pointer Notation and Arrays–Differences Between Arrays and Pointers
using pointers as, Using malloc to Create a One-Dimensional Array, Dynamically Allocating a Two-Dimensional Array–Jagged Arrays and Pointers
resizing, Using the realloc Function to Resize an Array–Using the realloc Function to Resize an Array
size of, Quick Review of Arrays, One-Dimensional Arrays, Two-Dimensional Arrays, Differences Between Arrays and Pointers, Calculating the Array Size Incorrectly–Calculating the Array Size Incorrectly
sorting, Function Pointers and Strings–Function Pointers and Strings
two-dimensional, Two-Dimensional Arrays–Two-Dimensional Arrays, Dynamically Allocating a Two-Dimensional Array–Allocating Contiguous Memory
VLA (Variable Length Array), The alloca Function and Variable Length Arrays–The alloca Function and Variable Length Arrays
ASLR (Address Space Layout Randomization), Security Issues and the Improper Use of Pointers
assert function, Dealing with Uninitialized Pointers
assert.h file, Dealing with Uninitialized Pointers
assignment operator (, Using malloc with static and global pointers
asterisk (*)
indirection (dereference) operator, Dereferencing a Pointer Using the Indirection Operator, Pointer Operators, Dynamic Memory Allocation, Misuse of the Dereference Operator–Misuse of the Dereference Operator
in pointer declaration, Declaring Pointers, Pointer Operators, Misuse of the Dereference Operator–Misuse of the Dereference Operator
automatic memory, Pointers and Memory
automatic variables (see local variables)
Bounded Model Checking application, Bounded Pointers
array misuse causing, Accessing Memory Outside the Bounds of an Array–Calculating the Array Size Incorrectly dangling pointers causing, Dangling Pointers dereference operator misuse causing, Misuse of the Dereference Operator–Misuse of the Dereference Operator function pointer misuse causing, Function Pointer Issues–Function Pointer Issues malloc failure causing, Test for NULL pointer arithmetic on structures causing, Pointer Arithmetic and Structures–Pointer Arithmetic and Structures pointer type mismatch causing, Always Match Pointer Types–Always Match Pointer Types sizeof operator misuse causing, Misusing the sizeof Operator string misuse causing, String Security Issues–String Security Issues byte strings, String Fundamentals
char data type, String Fundamentals intptr_t type, Using intptr_t and uintptr_t–Using intptr_t and uintptr_t memory models for, Memory Models size_t type, Understanding size_t–Understanding size_t uintptr_t type, Using intptr_t and uintptr_t–Using intptr_t and uintptr_t union of, Aliasing, Strict Aliasing, and the restrict Keyword, Using a Union to Represent a Value in Multiple Ways–Using a Union to Represent a Value in Multiple Ways wchar_t data type, String Fundamentals
callback functions, Odds and Ends, Accessing Memory using DMA, Using Function Pointers to Support Callbacks–Using Function Pointers to Support Callbacks calloc function, Dynamic Memory Allocation Functions, Using the calloc Function–Using the calloc Function casting, Pointer Operators, Casting Pointers–Casting Pointers endianness, determining, Determining the Endianness of a Machine function pointers, Casting Function Pointers–Casting Function Pointers integer to pointer to an integer, Address of Operator with malloc function, To cast or not to cast pointer to an integer, Using intptr_t and uintptr_t ports, accessing, Accessing a Port–Accessing a Port special purpose addresses, accessing, Accessing a Special Purpose Address–Accessing a Special Purpose Address CERT organization, Security Issues and the Improper Use of Pointers cfree function, Using the calloc Function char data type, String Fundamentals character literals, String Fundamentals, Initializing a pointer to a char characters array of, strings declared as, String Declaration pointers to, String Declaration, Aliasing, Strict Aliasing, and the restrict Keyword code examples, permission to use, Using Code Examples command-line arguments, Passing Arguments to an Application–Passing Arguments to an Application compact expressions, Why You Should Become Proficient with Pointers comparison operators, Pointer Operators, Comparing Pointers–Comparing Pointers, Comparing Function Pointers–Comparing Function Pointers compilers, Preface (see also specific compilers) problems detected by, Using Static Analysis Tools–Using Static Analysis Tools compound literals, arrays using, Jagged Arrays and Pointers–Jagged Arrays and Pointers constant pointers assigning NULL to, Assigning NULL to a Freed Pointer to constants, Constant pointers to constants–Constant pointers to constants to nonconstants, Constant pointers to nonconstants–Constant pointers to nonconstants pointers to, Pointer to (constant pointer to constant) constants declaring string literals as, When a string literal is not a constant pointers to, Pointers to a constant–Pointers to a constant, Passing a Pointer to a Constant–Passing a Pointer to a Constant contact information for this book, How to Contact Us conventions used in this book, Conventions Used in This Book
data corruption returning pointers to local data causing, Pointers to Local Data writing outside of memory block causing, Dynamic Memory Allocation Data Execution Prevention (DEP), Security Issues and the Improper Use of Pointers data types (see C data types) declaration of arrays, One-Dimensional Arrays–Multidimensional Arrays declaration of pointers, Declaring Pointers–How to Read a Declaration to functions, Pointers to Functions, Declaring Function Pointers–Declaring Function Pointers improper, Improper Pointer Declaration–Improper Pointer Declaration reading, How to Read a Declaration declaration of strings, String Declaration–String Declaration declaration of structures, Introduction–Introduction
denial of service attack, Pointer Usage Issues, Double Free DEP (Data Execution Prevention), Security Issues and the Improper Use of Pointers dereferencing pointers, Dereferencing a Pointer Using the Indirection Operator errors involving, Dynamic Memory Allocation, Misuse of the Dereference Operator–Misuse of the Dereference Operator multiple levels of indirection, Multiple Levels of Indirection–Multiple Levels of Indirection, Pointer to (constant pointer to constant) null pointers, The Concept of Null DMA (Direct Memory Access), Accessing Memory using DMA dot notation, Introduction double free, Double Free–Double Free, Double Free double pointers (see multiple levels of indirection) double quotes (“ ”), enclosing string literals, String Declaration dynamic memory, Pointers and Memory, Dynamic Memory Management in C–Dynamic Memory Management in C allocating, Why You Should Become Proficient with Pointers, Dynamic Memory Allocation–Dynamic Memory Allocation, Dynamic Memory Allocation Functions–The alloca Function and Variable Length Arrays amount allocated, Determining the amount of memory allocated for arrays, Using malloc to Create a One-Dimensional Array, Dynamically Allocating a Two-Dimensional Array–Allocating Contiguous Memory checking return value of, Test for NULL failure to, Failing to allocate memory in a function, Returning a Pointer–Returning a Pointer deallocating, Why You Should Become Proficient with Pointers, Dynamic Memory Allocation, Dynamic Memory Allocation, Using the calloc Function, Deallocating Memory Using the free Function–Freeing Memory upon Program Termination after returning from a function, Returning a Pointer at application termination, Freeing Memory upon Program Termination assigning NULL after, Assigning NULL to a Freed Pointer, Double Free availability to application, The Heap and System Memory clearing sensitive data when, Clearing Sensitive Data exception handling for, Using Exception Handlers failure to, hidden memory leaks from, Hidden memory leaks garbage collection for, Garbage Collection in C RAII for, Resource Acquisition Is Initialization–Resource Acquisition Is Initialization referencing pointer following (see dangling pointers) twice, Double Free–Double Free, Double Free writing your own function for, Writing your own free function–Writing your own free function managing your own pool of, Avoiding malloc/free Overhead–Avoiding malloc/free Overhead
equal sign (
assignment operator, Using malloc with static and global pointers
initialization operator, Using malloc with static and global pointers
equal sign, double (=
, equality operator, Pointer Operators
exception handling, Using Exception Handlers
exclamation point, equal sign (!
, inequality operator, Pointer Operators
fonts used in this book, Conventions Used in This Book format string attack, String Security Issues fprintf function, String Security Issues free function, Why You Should Become Proficient with Pointers, Dynamic Memory Allocation, Dynamic Memory Allocation, Dynamic Memory Allocation Functions, Deallocating Memory Using the free Function–Deallocating Memory Using the free Function at application termination, Freeing Memory upon Program Termination assigning NULL after, Assigning NULL to a Freed Pointer, Double Free clearing sensitive data when, Clearing Sensitive Data not used, hidden memory leaks from, Hidden memory leaks overhead incurred by, Avoiding malloc/free Overhead–Avoiding malloc/free Overhead referencing pointer following (see dangling pointers) used twice (double free), Double Free–Double Free, Double Free writing your own, Writing your own free function–Writing your own free function function pointers, Function Pointers–Casting Function Pointers array of, Using an Array of Function Pointers–Using an Array of Function Pointers calling, Using a Function Pointer–Using a Function Pointer casting, Casting Function Pointers–Casting Function Pointers comparing, Comparing Function Pointers–Comparing Function Pointers declaration of, Pointers to Functions, Declaring Function Pointers–Declaring Function Pointers improper use of, Function Pointer Issues–Function Pointer Issues passing as parameters, Passing Function Pointers–Passing Function Pointers, Function Pointers and Strings–Function Pointers and Strings performance of, Function Pointers returning from a function, Returning Function Pointers functions, Preface (see also specific functions) callback functions, Odds and Ends, Accessing Memory using DMA, Using Function Pointers to Support Callbacks–Using Function Pointers to Support Callbacks parameters of (see parameters) returning function pointers from, Returning Function Pointers returning pointers from, Returning a Pointer–Pointers to Local Data returning strings from, Returning Strings–Returning the address of a local string stack used by, Pointers and Functions–Organization of a Stack Frame
memory leak detection, Debug Version Support for Detecting Memory Leaks modification of string literals, When a string literal is not a constant string pooling turned off for, The String Literal Pool -Wall option, reporting compiler warnings, Using Static Analysis Tools gets function, String Security Issues global memory, Pointers and Memory global pointers, Global and static pointers, Using malloc with static and global pointers global variables, Dynamic Memory Management in C, Using malloc with static and global pointers
dlmalloc, Dynamic Memory Allocation Technologies
corruption of double free causing, Double Free writing outside of memory block causing, Dynamic Memory Allocation detecting problems with, Debug Version Support for Detecting Memory Leaks dynamic memory allocated from (see dynamic memory)
indirection (dereference) operator (*), Preface, Dereferencing a Pointer Using the Indirection Operator, Pointer Operators, Dynamic Memory Allocation, Misuse of the Dereference Operator–Misuse of the Dereference Operator
(see also dereferencing)
inequality operator (!, Pointer Operators
inheritance, Polymorphism in C–Polymorphism in C
initialization of pointers, Address of Operator–Address of Operator
failure to, Failure to Initialize a Pointer Before It Is Used–Dealing with Uninitialized Pointers, Using Static Analysis Tools
to NULL, Dealing with Uninitialized Pointers
initialization operator (
, Using malloc with static and global pointers
integers, casting to a pointer to an integer, Address of Operator
intptr_t type, Using intptr_t and uintptr_t–Using intptr_t and uintptr_t
J
jagged arrays, Jagged Arrays and Pointers–Jagged Arrays and Pointers
L
left angle bracket (<), less than operator, Pointer Operators
left angle bracket, equal sign (⇐), less than or equal operator, Pointer Operators
less than operator (<), Pointer Operators
less than or equal operator (⇐), Pointer Operators
linked lists, Single-Linked List–Single-Linked List
implementing as arrays, Why You Should Become Proficient with Pointers
implementing as pointers, Why You Should Become Proficient with Pointers
local variables
returning pointers to, Pointers to Local Data–Pointers to Local Data
stack used by, Dynamic Memory Management in C, Program Stack, Organization of a Stack Frame, Organization of a Stack Frame
lvalue, required to be modifiable, Dereferencing a Pointer Using the Indirection Operator, Differences Between Arrays and Pointers
M
macro definitions, declaring pointers using, Improper Pointer Declaration
malloc function, Why You Should Become Proficient with Pointers, Dynamic Memory Allocation–Dynamic Memory Allocation, Dynamic Memory Allocation Functions–Using malloc with static and global pointers
checking return value of, Test for NULL
creating arrays using, Using malloc to Create a One-Dimensional Array, Dynamically Allocating a Two-Dimensional Array–Allocating Contiguous Memory
implementations of, Dynamic Memory Allocation Technologies
initializing strings using, Initializing a pointer to a char
overhead incurred by, Avoiding malloc/free Overhead–Avoiding malloc/free Overhead
for returning a pointer from a function, Returning a Pointer–Returning a Pointer
malloca function, The alloca Function and Variable Length Arrays
memory
automatic memory, Pointers and Memory
dynamic memory (see dynamic memory)
global memory, Pointers and Memory
heap (see heap)
lifetime of, Pointers and Memory
scope of, Pointers and Memory
special purpose addresses, accessing, Accessing a Special Purpose Address–Accessing a Special Purpose Address
stack (see stack)
static memory, Pointers and Memory
types of, Pointers and Memory
virtual memory addresses, Virtual memory and pointers
memory leaks, Memory Leaks–Hidden memory leaks
detecting, Debug Version Support for Detecting Memory Leaks
failure to deallocate returned pointers causing, Returning a Pointer
hidden, Hidden memory leaks
lost address causing, Losing the address
structure pointers not deallocated causing, Structure Deallocation Issues
memory models, for C data types, Memory Models
memset function, Using the calloc Function, Accessing a Special Purpose Address
Microsoft compiler
exception handling, Using Exception Handlers
malloca function, The alloca Function and Variable Length Arrays
memory management, Debug Version Support for Detecting Memory Leaks
minus sign (-), subtraction operator, Pointer Operators
minus sign, right angle bracket (→), points-to operator, Pointer Operators, Introduction
Mudflap Libraries, Debug Version Support for Detecting Memory Leaks
multiple levels of indirection, Multiple Levels of Indirection–Multiple Levels of Indirection, Pointer to (constant pointer to constant)
N
near pointers, Using intptr_t and uintptr_t
NUL ASCII character, The Concept of Null, To NULL or not to NULL, String Fundamentals
NULL
assigning to constant pointers, Assigning NULL to a Freed Pointer
assigning to freed pointer, Assigning NULL to a Freed Pointer
initializing pointers with, Dealing with Uninitialized Pointers
NULL macro, The Concept of Null
null pointers, The Concept of Null–To NULL or not to NULL, Passing Null Pointers
O
%o field specifier, printf function, Displaying Pointer Values
object-oriented type support, Odds and Ends, Object-Oriented Techniques–Polymorphism in C
opaque pointers for, Creating and Using an Opaque Pointer–Creating and Using an Opaque Pointer
polymorphism and inheritance, Polymorphism in C–Polymorphism in C
opaque pointers, Creating and Using an Opaque Pointer–Creating and Using an Opaque Pointer
OpenBSD malloc, Dynamic Memory Allocation Technologies
operators, Pointer Operators–Comparing Pointers
arithmetic operators, Pointer Operators, Pointer Arithmetic–Subtracting two pointers
comparison operators, Pointer Operators, Comparing Pointers–Comparing Pointers
list of, Pointer Operators
overloading of zero (0), To NULL or not to NULL
P
%p field specifier, printf function, Displaying Pointer Values–Displaying Pointer Values
parameters
passed by pointer, Passing and Returning by Pointer–Passing Data Using a Pointer
passed by value, Passing and Returning by Pointer, Passing Data by Value
passing a pointer to a pointer as, Passing a Pointer to a Pointer–Writing your own free function
passing arrays as, Passing a One-Dimensional Array–Using Pointer Notation
passing function pointers as, Passing Function Pointers–Passing Function Pointers
passing multidimensional arrays as, Passing a Multidimensional Array–Passing a Multidimensional Array
passing null pointers to, Passing Null Pointers
passing pointers to constants as, Passing a Pointer to a Constant–Passing a Pointer to a Constant
passing strings as, Pointers and Strings, Passing Strings–Passing a String to Be Initialized
stack used by, Organization of a Stack Frame, Organization of a Stack Frame
parentheses 1)
enclosing data type to cast, Pointer Operators
in pointer to function declarations, Pointers to Functions, Declaring Function Pointers
plus sign (+), addition operator, Pointer Operators
pointer arithmetic, Pointer Arithmetic
with arrays, Pointer Notation and Arrays
not using with structures, Pointer Arithmetic and Structures–Pointer Arithmetic and Structures
on pointers to void, Pointers to void and addition
pointers, Introduction–Pointers and Memory
aliasing, Dangling Pointer Examples, Copying Strings, Aliasing, Strict Aliasing, and the restrict Keyword–Using the restrict Keyword
arrays of, Using a One-Dimensional Array of Pointers–Using a One-Dimensional Array of Pointers
to arrays, Pointer Notation and Arrays–Differences Between Arrays and Pointers
using as arrays, Using malloc to Create a One-Dimensional Array, Dynamically Allocating a Two-Dimensional Array–Jagged Arrays and Pointers
benefits of, Why You Should Become Proficient with Pointers–Why You Should Become Proficient with Pointers
bounded pointers, Bounded Pointers
to characters, String Declaration, Aliasing, Strict Aliasing, and the restrict Keyword
compared to arrays, Pointers and Arrays, Quick Review of Arrays
compared to handles, Casting Pointers
to constant char, passing strings as, Passing a Pointer to a Constant char
constant pointers
assigning NULL to, Assigning NULL to a Freed Pointer
to constants, Constant pointers to constants–Constant pointers to constants
to nonconstants, Constant pointers to nonconstants–Constant pointers to nonconstants
to constant pointers, Pointer to (constant pointer to constant)
to constants, Pointers to a constant–Pointers to a constant, Passing a Pointer to a Constant–Passing a Pointer to a Constant
dangling pointers, Assigning NULL to a Freed Pointer, Dangling Pointers–Debug Version Support for Detecting Memory Leaks, Dangling Pointers
data types for, Predefined Pointer-Related Types–Using intptr_t and uintptr_t
declaration of, Declaring Pointers–How to Read a Declaration
improper, Improper Pointer Declaration–Improper Pointer Declaration
reading, How to Read a Declaration
dereferencing, Dereferencing a Pointer Using the Indirection Operator
errors involving, Dynamic Memory Allocation, Misuse of the Dereference Operator–Misuse of the Dereference Operator
multiple levels of indirection, Multiple Levels of Indirection–Multiple Levels of Indirection, Pointer to (constant pointer to constant)
null pointers, The Concept of Null
to functions, Function Pointers–Casting Function Pointers
arrays of, Using an Array of Function Pointers–Using an Array of Function Pointers
calling, Using a Function Pointer–Using a Function Pointer
casting, Casting Function Pointers–Casting Function Pointers
comparing, Comparing Function Pointers–Comparing Function Pointers
declaration of, Pointers to Functions, Declaring Function Pointers–Declaring Function Pointers
improper use of, Function Pointer Issues–Function Pointer Issues
passing as parameters, Passing Function Pointers–Passing Function Pointers, Function Pointers and Strings–Function Pointers and Strings
performance of, Function Pointers
returning from a function, Returning Function Pointers
global pointers, Global and static pointers, Using malloc with static and global pointers
improper use of, detecting, Using Static Analysis Tools–Using Static Analysis Tools
initialization of, Address of Operator–Address of Operator
failure to, Failure to Initialize a Pointer Before It Is Used–Dealing with Uninitialized Pointers, Using Static Analysis Tools
to NULL, Dealing with Uninitialized Pointers
memory for (see dynamic memory)
to multidimensional arrays, Pointers and Multidimensional Arrays–Pointers and Multidimensional Arrays
null pointers, The Concept of Null–To NULL or not to NULL, Passing Null Pointers
opaque pointers, Creating and Using an Opaque Pointer–Creating and Using an Opaque Pointer
operators for, Pointer Operators–Comparing Pointers
parameters passed by, Passing and Returning by Pointer–Passing Data Using a Pointer
to pointers, passing as parameters, Passing a Pointer to a Pointer–Writing your own free function
potential problems with, Why You Should Become Proficient with Pointers–Why You Should Become Proficient with Pointers
returning from functions, Returning a Pointer–Pointers to Local Data
size of, Pointer Size and Types–Using intptr_t and uintptr_t
smart pointers, Bounded Pointers
static pointers, Global and static pointers, Using malloc with static and global pointers
structures implemented using, Using Pointers to Support Data Structures–Using Pointers to Support Data Structures
linked lists, Single-Linked List–Single-Linked List
queues, Using Pointers to Support a Queue–Using Pointers to Support a Queue
stacks, Using Pointers to Support a Stack–Using Pointers to Support a Stack
trees, Using Pointers to Support a Tree–Using Pointers to Support a Tree
to structures, declaration of, Introduction
types of, matching, Always Match Pointer Types–Always Match Pointer Types, Using Static Analysis Tools
undefined behavior of, Why You Should Become Proficient with Pointers
validation function for, Bounded Pointers
value of (an address)
before initialization, Declaring Pointers
displaying, Displaying Pointer Values–Virtual memory and pointers
losing, memory leaks from, Losing the address
as virtual memory address, Virtual memory and pointers
to void, Pointer to void–Pointer to void, Pointers to void and addition
wild pointers, Failure to Initialize a Pointer Before It Is Used–Dealing with Uninitialized Pointers
zero (0) assigned to, The Concept of Null, To NULL or not to NULL
points-to operator (→), Pointer Operators, Introduction
polymorphism, Polymorphism in C–Polymorphism in C
ports, accessing, Accessing a Port–Accessing a Port
printf function
field specifiers for displaying pointer values, Displaying Pointer Values–Displaying Pointer Values
user-supplied format strings, not using, String Security Issues
program stack (see stack)
program termination
address of zero (0) causing, Address of Operator
buffer overflow causing, Pointer Usage Issues
dangling pointers causing, Dealing with Dangling Pointers
dereferencing null pointer causing, The Concept of Null
double free causing, Double Free
freeing memory at, Freeing Memory upon Program Termination
invalid address causing, Declaring Pointers
memory leaks causing, Memory Leaks, Hidden memory leaks
stack overflow causing, Organization of a Stack Frame
string initialized with character literal causing, Initializing a pointer to a char
uninitialized pointers causing, Failure to Initialize a Pointer Before It Is Used
Q
queues, Using Pointers to Support a Queue–Using Pointers to Support a Queue
quotes (see double quotes; single quotes)
R
RAII (Resource Acquisition Is Initialization), Resource Acquisition Is Initialization–Resource Acquisition Is Initialization
realloc function, Dynamic Memory Allocation Functions, Using the realloc Function–Using the realloc Function, Using the realloc Function to Resize an Array–Using the realloc Function to Resize an Array
restrict keyword, Using the restrict Keyword–Using the restrict Keyword
return-to-libc attack, Security Issues and the Improper Use of Pointers
right angle bracket (>), greater than operator, Pointer Operators
right angle bracket, equal sign (>
, greater than or equal operator, Pointer Operators
runtime system, Dynamic Memory Management in C
S
scanf_s function, String Security Issues
security, Security Issues and the Improper Use of Pointers–Security Issues and the Improper Use of Pointers
ASLR, Security Issues and the Improper Use of Pointers
buffer overflow (see buffer overflow)
CERT organization, Security Issues and the Improper Use of Pointers
clearing sensitive data, Clearing Sensitive Data
denial of service attack, Pointer Usage Issues, Double Free
DEP, Security Issues and the Improper Use of Pointers
format string attack, String Security Issues
malicious code inserted in memory, Security Issues and the Improper Use of Pointers, Pointer Usage Issues, Double Free
return-to-libc attack, Security Issues and the Improper Use of Pointers
stack overflow, Organization of a Stack Frame, Pointer Usage Issues
VTable, exploitation of, Dangling Pointers
single quotes (' '), enclosing character literals, String Fundamentals
sizeof operator, Using the sizeof operator with pointers–Using the sizeof operator with pointers, Dynamic Memory Allocation
for arrays, One-Dimensional Arrays
with arrays, Two-Dimensional Arrays, Differences Between Arrays and Pointers
improper use of, Misusing the sizeof Operator
with pointers to void, Pointer to void
size_t type, Understanding size_t–Understanding size_t
smart pointers, Bounded Pointers
snprintf function, String Security Issues
special purpose addresses, accessing, Accessing a Special Purpose Address–Accessing a Special Purpose Address
stack, Pointers and Functions–Organization of a Stack Frame, Using Pointers to Support a Stack–Using Pointers to Support a Stack
alloca and malloca using, The alloca Function and Variable Length Arrays
block statements using, Dangling Pointer Examples, Organization of a Stack Frame
local variables using, Dynamic Memory Management in C, Program Stack, Organization of a Stack Frame, Organization of a Stack Frame
parameters using, Organization of a Stack Frame, Organization of a Stack Frame
threads using, Organization of a Stack Frame
VLAs using, The alloca Function and Variable Length Arrays
stack frames, Program Stack, Organization of a Stack Frame–Organization of a Stack Frame
stack overflow, Organization of a Stack Frame, Pointer Usage Issues
standard input, initializing strings from, Initializing a string from standard input
static analysis tools, Using Static Analysis Tools–Using Static Analysis Tools
static memory, Pointers and Memory
static pointers, Global and static pointers, Using malloc with static and global pointers
static variables, Dynamic Memory Management in C
malloc not used for, Using malloc with static and global pointers
returning pointers to, Pointers to Local Data
stddef.h file, The Concept of Null
stdio.h file, The Concept of Null, Understanding size_t
stdlib.h file, The Concept of Null, Understanding size_t, Dynamic Memory Allocation Functions
strcat function, Concatenating Strings–Concatenating Strings, String Security Issues
strcat_s function, String Security Issues
strcmp function, Comparing Strings
strcpy function, Initializing an array of char, Copying Strings–Copying Strings, String Security Issues
strcpy_s function, String Security Issues
strict aliasing, Aliasing, Strict Aliasing, and the restrict Keyword, Strict Aliasing–Strict Aliasing
string literal pool, The String Literal Pool–When a string literal is not a constant
string literals, String Declaration
declaring as a constant, When a string literal is not a constant
memory location for, The String Literal Pool–When a string literal is not a constant
modifying, When a string literal is not a constant
string.h file, String Fundamentals
strings, Pointers and Strings–Summary of string placement
byte strings, String Fundamentals
character literals, String Fundamentals
comparing, Comparing Strings–Comparing Strings, Function Pointers and Strings–Function Pointers and Strings
concatenating, Concatenating Strings–Concatenating Strings
copying, Copying Strings–Copying Strings
declared as array of characters, String Declaration
initializing, Initializing an array of char–Initializing an array of char
passing to functions, Passing a Simple String
declared as pointer to a character, String Declaration
initializing, Initializing a pointer to a char–Initializing a pointer to a char
passing to functions, Passing a Simple String
declared as string literal, String Declaration
initialization of, String Initialization–Initializing a string from standard input, Passing a String to Be Initialized–Passing a String to Be Initialized
length of, String Fundamentals, Initializing a pointer to a char
memory location of, Summary of string placement
passing as command-line arguments, Passing Arguments to an Application–Passing Arguments to an Application
passing to functions, Pointers and Strings, Passing Strings–Passing a String to Be Initialized
returning from functions, Returning Strings–Returning the address of a local string
wide strings, String Fundamentals
writing to memory outside of, String Security Issues–String Security Issues
strlcat function, String Security Issues
strlcpy function, String Security Issues
strlen function, Initializing a pointer to a char
strncat function, String Security Issues
strncpy function, String Security Issues
struct keyword, Introduction
structures, Pointers and Structures–Introduction
declaration of, Introduction–Introduction
dot notation for, Introduction
freeing, hidden memory leaks from, Hidden memory leaks
implementing with pointers, Using Pointers to Support Data Structures–Using Pointers to Support Data Structures
linked lists, Single-Linked List–Single-Linked List
memory allocation for, How Memory Is Allocated for a Structure–How Memory Is Allocated for a Structure
deallocation issues with, Structure Deallocation Issues–Structure Deallocation Issues
managing yourself, Avoiding malloc/free Overhead–Avoiding malloc/free Overhead
pointer arithmetic used with, Pointer Arithmetic and Structures–Pointer Arithmetic and Structures
pointers to, declaration of, Introduction
points-to operator for, Introduction
queues, Using Pointers to Support a Queue–Using Pointers to Support a Queue
stacks, Using Pointers to Support a Stack–Using Pointers to Support a Stack
trees, Using Pointers to Support a Tree–Using Pointers to Support a Tree
subtraction operator (-), Pointer Operators
syslog function, String Security Issues
T
TCMalloc, Dynamic Memory Allocation Technologies
threads, Odds and Ends, Threads and Pointers–Using Function Pointers to Support Callbacks
callback functions using, Using Function Pointers to Support Callbacks–Using Function Pointers to Support Callbacks
sharing pointers between, Sharing Pointers Between Threads–Sharing Pointers Between Threads
stack used by, Organization of a Stack Frame
trees, Using Pointers to Support a Tree–Using Pointers to Support a Tree
type punning, Using a Union to Represent a Value in Multiple Ways
typedefs
declaration of pointers using, Improper Pointer Declaration
declaration of structures using, Introduction
U
uintptr_t type, Using intptr_t and uintptr_t–Using intptr_t and uintptr_t
union of data types, Aliasing, Strict Aliasing, and the restrict Keyword, Using a Union to Represent a Value in Multiple Ways–Using a Union to Represent a Value in Multiple Ways
V
Variable Length Array (see VLA)
virtual memory addresses, Virtual memory and pointers
VLA (Variable Length Array), The alloca Function and Variable Length Arrays–The alloca Function and Variable Length Arrays, Using the realloc Function to Resize an Array
void, pointers to, Pointer to void–Pointer to void, Pointers to void and addition
volatile keyword, Accessing a Port
VTable (Virtual Table), exploitation of, Dangling Pointers
W
wchar.h file, String Fundamentals
wchar_t data type, String Fundamentals
website resources
C specification, Why You Should Become Proficient with Pointers
for this book, How to Contact Us
wide strings, String Fundamentals
wild pointers, Failure to Initialize a Pointer Before It Is Used–Dealing with Uninitialized Pointers
wscanf_s function, String Security Issues
assigned to pointers, The Concept of Null, To NULL or not to NULL as overloaded, To NULL or not to NULL
C Language: C Fundamentals, C Inventor - C Language Designer: Dennis Ritchie in 1972; C Standards: ANSI X3J11 (ANSI C); ISO/IEC JTC 1 (Joint Technical Committee 1) / SC 22 (Subcommittee 22) / WG 14 (Working Group 14) (ISO C); C Keywords, C Pointers, C Data Structures - C Algorithms, C Syntax, C Memory Management, C Recursion, C on Android, C on Linux, C on macOS, C on Windows, C Installation, C Containerization, C Configuration, C Compiler, C IDEs (CLion), C Development Tools, C DevOps - C SRE, C Data Science - C DataOps, C Machine Learning, C Deep Learning, C Concurrency, C History, C Bibliography, Manning C Programming Series, C Glossary, C Topics, C Courses, C Standard Library, C Libraries, C Frameworks, C Research, C GitHub, Written in C, C Popularity, C Awesome List, C Versions. (navbar_c)
© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.