Memory mapping of variable | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Memory mapping of variable

I want to find the memory mapping of char, but it didn't work? https://code.sololearn.com/cd4sn3dEzO80/?ref=app

22nd Apr 2020, 11:06 AM
Saber Ahmadzai
Saber Ahmadzai - avatar
2 Answers
0
you should cast the address to a void * to make it print what you expect: cout << static_cast<void*>(&a);
22nd Apr 2020, 11:48 AM
MO ELomari
0
u need to cast to void*
22nd Apr 2020, 11:51 AM
durian
durian - avatar