liveBook · Manning

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.

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
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.

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
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.

Read how Modern C, Third Edition explains declaration →

Also covered in

What to know first

Related concepts

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.