The purpose is so cout will output the address stored by the pointer; if you pass a char* it has special behavior that treats it as a C-string and outputs the characters at the memory address as though they were a C-string. This is not what you want if you want to see the address of the string, so you cast to a different pointer type to get the desired behavior.