Puzzle SL29


Rule 1.2b, 2.2, and 3.2

What does the following write to the monitor?


/* --- fileA.c --- */
int x = 8;

 
/* --- fileB.c --- */
#include <stdio.h>

static int x = 444 ;

void foo( int x )
{
  printf("parameter x: %d\n", x );
  x = 25;
  printf("parameter x: %d\n", x );
}

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

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

All three linkage types are found in this project.



Answer         Next Page         Previous Page Home