Click here to Skip to main content
15,747,908 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i know to see the address of different variables having different datatypes but i see during my practice that address of char type of variable is not shown
tell me why the compiler did not show the address for character type of variable like the others int ,float etc

What I have tried:

i know this method to see the address of any type of variable
char a;
cout<< &a <<endl;

if u know any other method then tell me
Updated 21-Jun-18 7:18am

cout << reinterpret_cast<void *>(&a) << endl;

(the << operator overload for char * argument assumes it is dealing with a C-like string)
Share this answer
You could learn the answer to all these basic questions by getting hold of a good book on C or C++, or finding an online tutorial.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900