This:
const char * terry = \"hello\";
cout<
prints hello
instead of the memory address of the \'h\'
.
You should change your code to this:
cout << static_cast(terry);
The problem is that <<
operator is overloaded for pointers to C-style strings for printing the content of the string. If you cast it to the raw pointer instead, you will have the default behaviour of printing pointer using iostreams as you want.