C语言15 取地址符号&的使用
&符号是取地址符,任何变量都可以使用&来获取地址,但不能用在常量上 struct Point { int x; int y; }; char a; short b; int c; Point p; printf("%p %p %p %p \n",&a,&b,&c,&p); printf("%x %x %x %x \n",&a,&b,&c,&p); printf("%x \n",&10); 16: char a; 17: short b; 18: int c; 19: Point p; 20: 21: printf("%p %p %p %p \n",&a,&b,&c,&p); 0040D408 lea eax,[ebp-14h] 0040D40B push eax 0040D40C lea ecx,[ebp-0Ch] 0040D40F push ecx 0040D410 lea edx,[ebp-8] 0040D413 push edx 0040D414 lea eax,[ebp-4] 0040D417 push eax 0040D418 push offset string "%p %p %p %p \n" (00422e90) 0040D41D call printf (0040d6c0) 0040D422 add esp,14h 22: printf("%x %x %x %x \n",&a,&b,&c,&p); 0040D425 lea ecx,[ebp-14h] 0040D428 push……