-
Reference:
- A reference must be initialized when it is declared.
- References cannot be NULL.
- References can be used ,simply, by name.
- Once a reference is initialized to a variable, it cannot be changed to refer to a variable object.
-
Pointer:
- A pointer can be initialized to any value anytime after it is declared.
- A pointer can be assigned to point to a NULL value.
- Pointers need tobe dereferenced with a *.
- A pointer can be changed to point to any variable of the same type.
https://www.educative.io/edpresso/differences-between-pointers-and-references-in-cpp