What does the '&' symbol before a variable name mean in C?

QuestionsQuestions8 SkillsProRead User Input in CAug, 20 2025
0361

In C, the & symbol before a variable name is used to obtain the address of that variable. This is known as the "address-of operator." When you use & in front of a variable, it returns a pointer to that variable's memory location.

For example:

int x = 10;
int *ptr = &x; // ptr now holds the address of x

In this example, ptr is a pointer that stores the address of the variable x.

0 Comments

no data
Be the first to share your comment!