Home >Backend Development >C++ >What does *& mean in c++
The & operator sequence in C means to first dereference a pointer and then take its address, similar to &x, where & is the address operator and is the dereference operator. The specific operations include: first dereferencing the pointer &x to get the value of the variable it points to, and then taking the address of the value to get the value of &x. Usage scenarios include passing pointers to pointers, manipulating arrays of pointers, and navigating in multi-level pointer structures. Note that & is different from &&, which is a logical operator used to compare boolean values, and you should avoid creating dangling pointers when using &.
The meaning of &* in C
The &* in C is an operator sequence that represents the A pointer is dereferenced and its address is taken.
Decomposition:
Specific operation:
Usage scenarios:
&* Mainly used when data needs to be accessed in a more precise way than ordinary pointers, for example:
Example:
int** p; // 双重指针 int* q = &*p; // q 指向 p 指向的变量 *q = 10; // 通过 q 修改 p 指向的变量
Note:
The above is the detailed content of What does *& mean in c++. For more information, please follow other related articles on the PHP Chinese website!