1:所谓变量,其实是内存地址的一个抽像名字罢了。在静态编译的程序中,所有的变量名都会在编译时被转成内存地址。机器是不知道我们取的名字的,只知道地址。
2:关于结构体:
#include <iostream>
using namespace std;
struct test
{
int i;
char* p;
short a;
};
int main(int argc, char const *argv[])
{
test t;
cout<<&t<<endl; //0x22fef4
cout<<&t.i<<endl; //0x22fef4</