從最近的作用域開始尋找,直到找到變量
#include <stdio.h> int main(int argc, const char * argv[]) { int a = 100; { int a = 200; printf("a = %d\n", a); } printf("a = %d\n", a); return 0; }out: a = 200
1 #include <stdio.h> 2 3 int main(int argc, const char * argv[]) { 4 int a = 100; 5 int b = 200; 6 7 printf("The address of a is %d\n", &a); 8 printf("The address of b is %d\n", &b); 9 10 return 0; 11 }out: The address of a is 1606416268