I am new to C++ and as I was reading MIT lecture note about pointer I recognize something strange:
Pointers are just variables storing integers – but those integers happen to be memory addresses, usually addresses of other variables. A pointer that stores the address of some variable x is said to point to x. We can access the value of x by dereferencing the pointer.
well and also I find that the pointer can have a type:
int *pointer ;
char * pointer ; //example
well it just said it's an int that hold an address why give it the same type as the thing it point at if it's just hold a reference to it not an actual value ?