I don't understand what the problem is...
cout needs to guess what you trying to output from the type.
imagine you print something like this:
cout << "hello world";
You probably expect it to output "hello world", not address of this string in memory. To do so, cout for char * type not printing the address that stored in this variable, instead it tries to print the string it points to. In your case your "string" is not initialized, so it's UB.
You can do something like static_cast<void*>(ptr) to print just pointer value