ProgrammingHardIBM · Deloitte pattern
Which identifier, even though declared at file scope, never has linkage at all in C?
- A. A plain global int variable
- B. A static global variable
- C. An enumeration constant (an enumerator from an enum)
- D. A function declared extern
Correct answer: C. An enumeration constant (an enumerator from an enum)
Enumerators are compile-time constants substituted wherever used; the standard explicitly states they have no linkage. A global variable always has some linkage (external by default, internal with static), and functions default to external linkage.
More C Programming questions
- What can printf legally print here? c int i = 0; printf("%d %d %d", i++, i++, i++);
- What happens when this is compiled? c int compute(int x); static int compute(int x) { return x 2; } int main(void) { printf("%d"…
- What is printed? c int a[] = {10, 20, 30, 40, 50}; printf("%d", a[1, 3]);
- What can be said about this program? c int main(void) { int arr[5]; arr[5] = 10; printf("%d", arr[5]); }
- What is the only output consistent with the C standard? c int a[3] = {10, 20, 30}; int p = a; printf("%d %d", p++, p);
- What is printed? c int x = 5; x = x++ + 1; printf("%d", x);