PieterP:
It is common practice to writeint *ptr = ...
, but this is equivalent toint* ptr = ...
.
It actually depends. I'm used to use int *ptr
myself. But the new codebase I'm working on requires int* ptr
.
Additionally, if you have:
void mess(String &msg) //pass by reference
and
void mess(String *msg) //pass by pointer
Most of the time you would want to use the first case because it is safer.