I wanted to inspect the address of my variable
volatile int clock;
cout << &clock;
But it always says that x is at address 1. Am i doing something wrong??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
iostreams will cast most pointers to
void *for display – but no conversion exists forvolatilepointers. As such C++ falls back to the implicit cast tobool. Cast tovoid*explicitly if you want to print the address: