没怎么明白全局变量和局部变量的概念和意义T^T
#include <stdio.h>
int x = 77;
void fn1()
{
printf("fn1(): x=%d\n", x);
}
int main()
{
int x = 10;
if(x>0)
{
int x = 100;
x /= 2;
printf("if语句内, x=%d\n", x);
}
printf("main方法内, x=%d\n", x);
fn1();
return 0;
}
全局变量和局部变量有什么关系吗?唉,反正就是没怎么搞懂T^T