First let us clarify the difference between declaration and definition :
Declaration of a variable/function simply declares that the variable/function exists somewhere in the program but the memory is not allocated for them. But the declaration of a variable/function serves an important role. And that is the type of the variable/function. Therefore, when a variable is declared, the program knows the data type of that variable. In case of function declaration, the program knows what are the arguments to that functions, their data types, the order of arguments and the return type of the function.
Coming to the definition, when we define a variable/function, apart from the role of declaration, it also allocates memory for that variable/function. Therefore, we can think of definition as a super set of declaration. (or declaration as a subset of definition).
From this explanation, it should be obvious that a variable/function can be declared any number of times but it can be defined only once. (Remember the basic principle that you can’t have two locations of the same variable/function).
Since the declaration can be done any number of times and definition can be done only once, we can notice that declaration of a function/variable can be added in several C/H files or in a single C/H file several times. But we notice the actual definition of the function/variable only once (i.e. in one file only). And as the extern extends the visibility to the whole program, the functions/variables can be used (called) anywhere in any of the files of the whole program provided the declaration of the function is known. (By knowing the declaration of the function, C compiler knows that the definition of the function/variable exists and it goes ahead to compile the program).
In the case of int a;, what it is depends on where it is placed in the source code:
Within a function, int a; is a definition - it requests the creation of an int variable with automatic storage duration (and of course
also a declaration);
At file scope, the answer is different in C and C++. In C, int a; is atentative definition (of which there can be more than one, as long as the types and linkage are agreeable); in C++, it is an ordinary definition with external linkage.
Within a struct or union specifier,int a; is a declaration of a member.