Opaque object
An opaque object is an object whose representation and contents are hidden and accessible only through specified operations.
Modern C
An opaque object is an object whose representation and contents can be accessed only through operations explicitly permitted by its abstraction.
- How it is used
- Uses opacity to reason about pointers and to separate library interfaces from hidden structure implementations.
- How deep it goes
- Defines permitted pointer operations and states, then explains forward declarations, stopping short of structure implementation details.
- Examples
- Uses string pointers, empty and null pointers, indeterminate pointers, and a forward-declared `struct toto` interface.
- What you can do after
- Evaluate C pointer states and design interfaces that conceal structure representations without hiding pointer semantics.
Modern C, Third Edition
An opaque structure is a C structure type whose complete member definition is hidden from code that uses its interface.
- How it is used
- Separates a library's public interface from its hidden structure implementation.
- How deep it goes
- Defines forward declarations, pointer use, representation rationale, and typedef visibility, but not the hidden structure's members.
- Examples
- Uses a forward-declared struct toto with get, destroy, and operation functions, plus pointer typedef alternatives.
- What you can do after
- Builds a client-facing C interface around a structure whose definition remains private to its implementation.
Related concepts
- referenceincludes · A reference is an indirect value or relationship that identifies or provides access to another value, object, resource, or source.
- structkind of · A struct is a composite data type or structure that groups related fields or values into a single unit.
- objectkind of · A computational object is a runtime entity or structured value representing data, state, or a resource, with properties or operations defined by its programming model.
- missing valueused by · A missing value is a marker or condition indicating that an expected data value or reference is absent, unavailable, unknown, or inapplicable.
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.

