$ cat test.c
#include <stdio.h>
int main(void)
{
test1();
test2();
return(0);
}
int test1(void)
{
static i = 1;
printf("%d\n",i);
return(0);
}
int test2(void)
{
printf("%d\n",i);
return(0);
}
administrator@WWSHAO ~
$ gcc -o test test.c
test.c: In function `test2':
test.c:16: `i' undeclared (first use in this function)
test.c:16: (Each undeclared identifier is reported only once
test.c:16: for each function it appears in.)