What does the file-scope declaration extern int count; do in C?
Correct answer C. It declares count without defining it, so the storage must be defined elsewhere
Explanation
extern without an initialiser is a declaration: it tells the compiler that an int named count exists with external linkage, but it does not allocate storage. Exactly one translation unit must provide the definition, such as int count = 0;, or the linker reports an undefined reference. Making a name private to a file is the job of static, not extern.
Answer checked How we write and check questions
Discussion