Answer SL22


8 

Comments: There is a single external entity that corresponds to the identifier x. The keyword extern is not needed in file fileC.c, but makes clear that its x is external.

/* --- fileA.c --- */
int x = 8
/* --- fileB.c --- */
void foo()
{
  int x;
  x = 99;
}
 
/* --- fileC.c --- */
#include <stdio.h>
void foo();

extern int x;
void main()
{
  foo();
  printf("%d\n", x );
}


Back to Puzzle Home