11-7全局变量作用域测试(2)(函数调用)
#include<stdio.h>
int a,b;
float c,d;
int main()
{
int f2();
int f1();
a=1;
b=2;
c=50.0;
d=60.0;
printf("i am in main1 a=%d b=%d c=%f d=%f\n",a,b,c,d);
f1();f2();
printf("i am in main2 a=%d b=%d c=%f d=%f\n",a,b,c,d);
return 0;
getchar();
}
int f2()
{
float c=100.0;
printf("i am in f2 a=%d b=%d c=%f d=%f\n",a,b,c,d);
}
int f1()
{
int a=10;
printf("i am in f1 a=%d b=%d\n",a,b);
}