|
|
char * is a known type for the stream and is printed accordingly. Change char -> void and you will see the address.
ostream& ostream::operator<< ( void* );ostream& operator<< ( ostream& os, const char* );const char* is closer match for char* than the void*.cout << static_cast<void*>(ptr) << endl;