liveBook · Manning

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.

How 2 Manning books explain it

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.

Read how Modern C explains declaration →

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.

Read how Modern C, Third Edition explains declaration →

Related concepts

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.