Declaration
A declaration is source syntax that introduces a program entity and specifies its name, type, or other properties without necessarily defining it or assigning a value.
Modern C
A declaration is a C construct that specifies the kind of entity an identifier refers to without necessarily defining the entity or providing its value.
- How it is used
- Specifies an identifier’s role and properties before its use in a C program.
- How deep it goes
- Works through function, array, variable, initializer, and extern examples, while deferring fuller complications of declarations and definitions.
- Examples
- Compares declarations of main, A, and i, then traces three declarations of i that denote two objects.
- What you can do after
- Diagnose/debug with it whether a declaration introduces a distinct object or names an existing one under extern and shadowing.
Modern C, Third Edition
A C declaration specifies the kind of entity an identifier refers to without necessarily allocating storage or supplying its concrete value.
- How it is used
- Tells the compiler what an identifier represents before that identifier is used.
- How deep it goes
- Explains declaration forms and their distinction from definitions, while deferring pointer details and qualifying its simplified initialization rule.
- Examples
- Uses function and array declarations, an initialized variable, and an array with designated initializers.
- What you can do after
- Apply it to identify what a C declaration specifies and distinguish it from an initialized object or function definition.
Related concepts
- function declarationcontrasts with · A function declaration is a source-language construct that specifies a function’s name and parameter interface, and may include its implementation.
- statementkind of · A statement is a syntactic program construct that performs an action, declaration, or control operation without necessarily producing an expression value.
- initializationconfigured by · Initialization is the process of establishing initial values or a starting state for a program entity, component, resource, or computation before subsequent operation.
- prototypeincludes · A function prototype is a declaration specifying a function’s name, return type, and parameter types without its implementation.
- semanticskind of · Semantics is the meaning and behavior conveyed or assigned to expressions, constructs, representations, or their combinations in a language or symbolic system.
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.

