C++ Syntax: Address: &
& is the unary address operator. When applied to a variable or object it
returns its address, a value that can be stored in a
Int_t my_int = 2;
Int_t *my_int_ptr =&my_int;
my_int_ptr holds a pointer to my_int.
Other Uses for &
When an & appears after a type name (either a basic data type or a
it means that the type is a
to that type, as in the declaration:-
Int_t &my_int = *your_int;
For a discussion of references, see
Pointers & References.
Go Back to the
The C++ Crib Top Page
If you have any comments about this page please send them to