Given the files:
// file: q7a.h
static int err_code = 3;
void printErrCode ();
///////////// END OF FILE /////////////////
// file: q7a.c
#include <stdio.h>
#include "q7a.h"
void printErrCode ()
{
printf ("%d ", err_code);
}
///////////// END OF FILE /////////////////
// file: q7main.c
#include "q7a.h"
int main()
{
err_code = 5;
printErrCode ();
return 0;
}
///////////// END OF FILE /////////////////
The output is:
3
My Question is why the output is not 5? Thanks.