#include <stdio.h> int x = 77; void fn1() { printf("fn1(): x=%d\n", x); } int main() { int x = 10; if(x>0) { static x = 100; x /= 2; printf("if語句內, x=%d\n", x); } printf("main方法內, x=%d\n", x);
#include <stdio.h>
int x = 77;
void fn1()
{
? ? printf("fn1(): x=%d\n", x); ? ? ??
}
int main()
{
? ? int x = 10;
? ? if(x>0)
? ? {
? ? ? ? ?static x = 100;
? ? ? ? x /= 2;
? ? ? ? printf("if語句內, x=%d\n", x); ? ? ??
? ? }
? ? printf("main方法內, x=%d\n", x);
? ? fn1();
? ? return 0;
}
2015-12-18
++++++++++++++++++++++++++++