Here is just a test prototype :
#include #include using namespace std; int main() { int a=10; char b=\'H\'; string
Expression &b has type char *. When operator << used fo an object of type char * it considers it as a string and outputs it as a string. To output the address you should write
( void * ) &b
or
reinterpret_cast( &b )