Puzzle SL26


What does the following project write to the monitor?


/* --- fileB.c --- */
int x = 444 ;
void foo()
{
  int x;
  x = 99;
}

/* --- fileC.c --- */
#include <stdio.h>
void foo();

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

Pay attention to how many entities x there are, and what happens to them.



Answer         Next Page         Previous Page Home