/* a1.c */#include<stdio.h>int i; /*定义一个外部变量i */void func();void main(){i=3;printf("%d\n",i);i+=2;func();printf("%d\n",i);}
/* a2.c */#include<stdio.h>extern int i; /* 说明i为外部变量 */void func(){printf("%d\n",i);i++; }