Definitions and ODR
Definitions and ODR
Definitions are declarations that fully define the entity introduced by the declaration. Every declaration is a definition, except for the following:
- A function declaration without a function body
int f(int); // declares, but doesn't define f
- Any declaration with an
extern
storage class specifier or with a language linkage specifier (such asextern "C"
) without an initializer
extern const int a; // declares, but doesn't define a extern const int b = 1; // defines b