Home >Backend Development >C#.Net Tutorial >What does & mean in c language
In C language, the & symbol is used to get the address of a variable: it is called the address operator. Used to get the address of a variable in memory. Store the address in a pointer variable or use it for pointer arithmetic. Cannot be used to obtain the address of a constant or literal. What does
& mean in C language?
In C language, the & symbol is used to get the address of a variable. It is called address operator.
Usage:
& operator followed by a variable name returns the address of the memory location where the variable is located. This address can be stored in a pointer variable or used in pointer arithmetic.
Example:
int x = 10; int *ptr = &x;
In the above example, &x returns the address of the x variable and assigns it to the pointer variable ptr. Now, the ptr variable stores the address of the memory location where the x variable resides.
Note:
The above is the detailed content of What does & mean in c language. For more information, please follow other related articles on the PHP Chinese website!