headers.h
#include<stdio.h>
#include<stdlib.h>
static int static_val=10;
main.c
#include "headers.h"
int main()
{
static_val += 10;
if (static_val <= 100)
{
printf("main called\n");
printf("%d\n",static_val);
main();
}
else
printf("stopped calling 'main', with final value = %d\n",static_val);
function1();
}
file.c
#include "headers1.h"
void function1(void)
{
static int inc;
inc++;
printf("*************\n");
printf("function1 called %d time.\n",inc);
printf("%d\n",static_val);
printf("Initial Value = %d\n",static_val);
static_val += 20;
printf("%d\n",static_val);
printf("**************\n");
}
说明: