<<< Pointer syntax | Index | String literal >>> |
An address &x tells where the variable is located in memory.
Pointer points to a variable by remembering its address:
ptr = &x;
Pointers are variables and must be declared:
double* d_ptr;
Here, asterisk * identifies d_ptr as a pointer variable.
The phrase "variable pointed to by pointer ptr" is translated into C++ as
*ptr
where * is the dereference operator.
<<< Pointer syntax | Index | String literal >>> |