declaration versus definition
Suppose your friend mentions 'a colleague named Sam'. Now you know Sam exists and is a person, but you have not met Sam or been given an office for them. Introducing the name and kind is a declaration. Actually setting aside a desk and bringing Sam in is a definition. C draws exactly this line: a declaration tells the compiler that a name exists and what type it has; a definition is the one that actually creates the thing and reserves storage (or, for a function, supplies its body).
For a variable, 'int count;' at file scope is a definition — it both names count and allocates the storage. Writing 'extern int count;' is only a declaration — it promises that count is defined somewhere else, perhaps in another source file. For a function, 'int add(int a, int b);' is a declaration (a prototype) — it announces the function's shape so callers can be checked — while 'int add(int a, int b) { return a + b; }' is the definition that gives the actual code. The rule of thumb: every name may be declared many times but must be defined exactly once across the whole program (the one-definition rule).
Why this matters: this split is what lets large programs span many files. Headers carry declarations so every file agrees on the shape of shared functions and variables, while exactly one source file holds each definition. Get it wrong and the linker complains: an undefined reference means you declared and used something but never defined it; a multiple definition means you defined it more than once.
/* in header.h, a declaration */ extern int count; int add(int a, int b); /* in one .c file, the definitions */ int count = 0; int add(int a, int b) { return a + b; }
The header declares (announces) shared names; one source file defines (creates) them. extern marks a variable declaration that is not a definition.
A function prototype is a declaration, not a definition. A variable definition allocates storage; an extern declaration does not. Define each name exactly once program-wide — too few definitions gives an 'undefined reference' linker error, too many gives 'multiple definition'.