Pointers
The dereference operator *
is used to access the object pointed by a pointer.
int target = 20;
int *p = ⌖
// Prints out the value pointed by p which is 20.
std::cout << *p << std::endl;
Note that the asterisk *
is also used to declare pointer types.
p
.*p
to get the value pointed by p
.