A very basic question. What does the ** operator in C++ do? For example:
It appears to be a pointer to a pointer. In the above example, it may be the right * indicates a pointer to a string (holding the address of the first character of the string), but what does the left * indicate? A pointer to the pointer?
* isn't an operator, it's a declarator: the * declarator (pointer declarator). No operator gets called here; the * just tells the compiler you want the variable "matrix" to be a pointer to pointer to int.
But here, when * is used to dereference a pointer
int* pelem = *matrix;
or double dereference it
int elem = **matrix;
then it's the pointer operator (or indirection operator/dereference operator)
Same deal with &
int& count = getCount();
Here & is the reference declarator.
int* pint = &some_int_value;
Here it's the address-of operator (the name "reference operator" is also used, though it's not in the C++ standard.)