Declaration
A declaration is a language construct that introduces a program entity or name and specifies information about it, such as its type or properties.
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
- Introduces declarations as the means of specifying identifiers before use in C programs.
- How deep it goes
- Explains declaration syntax, definitions, initialization, scope, shadowing, and an extern example, while deferring some complications of definitions.
- Examples
- Uses declarations of a function, array, and variable, an initialized variable, and nested declarations involving extern.
- What you can do after
- Evaluate and understand how declarations specify identifiers and when examples also define objects.
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
- Distinguishes what identifiers represent from where objects are defined and what statements do.
- How deep it goes
- Explains declaration forms and their relationship to definitions, while deferring detailed pointer treatment.
- Examples
- Uses declarations of `main`, `argc`, `argv`, and `A`, plus an initialized `size_t i`.
- What you can do after
- Evaluate and understand whether an example declaration also defines an initialized object or a function body.
Also covered in
- 100 C++ Mistakes and How to Avoid Them
- F# in Action: A Revised Edition of Get Programming with F#
- Rust in Action: Systems programming concepts and techniques
What to know first
- C programA C program is a computer program expressed in the C programming language.
- loopA loop is a programming-language control-flow construct that repeatedly executes a block of instructions according to an iteration rule or continuation condition.
- functionA function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- size_tsize_t is an unsigned integer type in C and C++ used to represent object sizes and related counts.
Related concepts
- function declarationcontrasts with · A function declaration is a source-language construct that introduces a function by specifying its name and parameter interface, and may also provide its implementation.
- destructuring declarationincludes · A destructuring declaration is Kotlin syntax that initializes multiple variables from the component values of an expression.
- object declarationincludes · An object declaration is a Kotlin declaration that defines a singleton object and creates its sole instance as part of the declaration.
- statementkind of · A statement is a syntactic unit in a programming or query language that expresses an instruction, declaration, or control operation for a processor to execute.
Questions about declaration
What is declaration?
A declaration is a language construct that introduces a program entity or name and specifies information about it, such as its type or properties.
Which Manning books explain declaration?
Modern C and Modern C, Third Edition.
What should I know before learning declaration?
Manning books that teach declaration usually introduce C program, loop, function and size_t first.
What is the difference between declaration and function declaration?
A declaration is a language construct that introduces a program entity or name and specifies information about it, such as its type or properties. A function declaration is a source-language construct that introduces a function by specifying its name and parameter interface, and may also provide its implementation.
What kinds of declaration are there?
Kinds of declaration include abstract property declaration, destructuring declaration, object declaration and variable declaration.
What is declaration a kind of?
Declaration is a kind of statement. A statement is a syntactic unit in a programming or query language that expresses an instruction, declaration, or control operation for a processor to execute.
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.

