C Primer Plus (5th Edition)

I l @ ve RuBoard

Pointer-Related Operators

& is the address operator. When followed by a variable name , & gives the address of that variable.

* is the indirection or dereferencing operator. When followed by a pointer, * gives the value stored at the pointed-to address.

Example

&nurse is the address of the variable nurse .

nurse = 22; ptr = &nurse; /* pointer to nurse */ val = *ptr;

The net effect is to assign the value 22 to val .

I l @ ve RuBoard

Категории