用于:
int *a;
Run Code Online (Sandbox Code Playgroud)
a是可以存储整数的地址.
&a是存储a的地址.然后,&a存储在哪里?并且,&(&a)存储在哪里?并且,&(&(&a))存储在哪里?地址存储在哪里停止?
如果您没有明确写入&a它将不会存储在任何地方.如果你写了,那么地址将被计算并存储在一个未命名的变量(临时)或你编写的命名变量中.
例如:
functionCall( &a ); // address will be in a temporary variable used for passing the parameter
int** b = &a; // address will be stored in variable b
otherFunctionCall( &&a ); // illegal, since &a is an expression operator & can't be applied to it
Run Code Online (Sandbox Code Playgroud)
&a是一个常数。
&(&a)是非法的。