Thanks in advance!
Code:
#include <stdio.h>
int global = 4;
void foo();
main() {
int id = -2;
printf("main(): global = %d\n" , global) ;
foo();
foo();
id = fork();
if (id != 0) {
global++;
wait(NULL);
}
global++;
printf( "main(): global = %d\n" , global) ;
}
void foo() {
static int staticInt = 1;
int localInt = 3;
printf("foo(): staticInt = %d \n" , staticInt) ;
printf("foo(): localInt = %d \n" , localInt) ;
staticInt++;
localInt++;
}
