Both the & and &** operators in C are used to get addresses, but their subtle difference is that the & operator gets the address of a variable, which is stored in a pointer variable, and the pointer type points to the variable type. The &** operator gets the address of the pointer variable, stored in the pointer variable, and the pointer type points to the pointer type. Purpose: The & operator is used to get the address of a variable to be passed to a function or stored in another variable, while the &** operator is used to get the address of a pointer variable and is used to create a pointer to a pointer.
The & and &** operators in C
In C, The & and & operators are used to get the address of a variable, but they have a subtle difference:
& Operator:
Example:
int num = 10; int *ptr = # // ptr 现在指向 num 的地址,类型为 int*
& Operator: **
Example:
int num = 10; int *ptr = # int **ptrptr = &ptr; // ptrptr 现在指向 ptr 的地址,类型为 int**
Difference:
Purpose: The
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!