Finding Addresses: The & Operator
One of the most important C concepts (and sometimes one of the most perplexing) is thepointer, which is a variable used to store an address. You've already seen that scanf() uses addresses for arguments. More generally, any C function that modifies a value in the calling function without using a return value uses addresses. We'll cover this topic next, beginning with the unary & operator.
The unary & operator gives you the address at which a variable is stored. If pooh is the name of a variable, then &pooh is the address of the variable. You can think of the address as a location in memory. Suppose you have the following statement:
pooh = 24;
Suppose that the address where pooh is stored is 0B76. (PC addresses ...
Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.