+ 7

I don't get the address of a character variable in c++ in the following. char c; cout<<&c; Please explain why? Thanks!

24th May 2020, 4:19 PM
Win Htay 🇲🇲
Win Htay 🇲🇲 - avatar
3 odpowiedzi
+ 2
thanks sir!
24th May 2020, 4:26 PM
Win Htay 🇲🇲
Win Htay 🇲🇲 - avatar
+ 1
you should cast the address to a void * to make it print what you expect: cout << static_cast<void*>(&a);
24th May 2020, 4:22 PM
MO ELomari
MO ELomari - avatar
+ 1
cout<<(void *) &c;
25th May 2020, 6:07 AM
PK Khan
PK Khan - avatar