Void pointer
A void pointer is a C pointer of type void* that can hold the address of an object without specifying its pointed-to object type.
Modern C, Third Edition
A void pointer is a C pointer to void that can hold the address of an object of any object type, subject to valid conversions and qualification rules.
- How it is used
- Supports generic data interfaces such as qsort and bsearch while leaving type recovery and safety to the caller.
- How deep it goes
- Explains conversions, identity preservation, qualification, and generic-interface hazards, but stops short of detailed implementation internals.
- Examples
- Uses qsort and bsearch signatures, an unsigned comparator, and invalid integer subtraction to expose generic-interface constraints.
- What you can do after
- Apply it via qsort or bsearch while matching element types, qualifications, sizes, and comparator behavior.
Modern C
A void pointer is a C pointer value of type void* that can hold the address of an object without retaining its pointed-to type information.
- How it is used
- Uses void* to abstract object types and make dynamic-allocation interfaces applicable to many object types.
- How deep it goes
- Defines conversion guarantees, storage abstraction, allocation behavior, and avoidance guidance, but does not develop implementation internals.
- Examples
- Demonstrates a double vector allocated with malloc and sized using sizeof *largeVec.
- What you can do after
- Apply void* through malloc and free while preserving correct object-pointer conversions and allocation sizes.
Related concepts
- referenceequivalent to · A reference is an indirect value or relationship that identifies or provides access to another value, object, resource, or source.
- function pointer typecontrasts with · A function pointer is a value that designates a callable function and can be stored, passed, or invoked indirectly.
- type informationcontrasts with · Type information is information that identifies or describes the types associated with program values, expressions, functions, or other typed entities.
- format stringused by · A format string is a character sequence containing literal text and directives that specify how supplied values are represented in formatted input or output.
- comparison functionused by · A comparison function or strategy compares two values and indicates their relative ordering, and sometimes whether they are equivalent.
- type safetycontrasts with · Type safety is the property that program operations respect type constraints, preventing or detecting invalid uses of values.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

