how to print address of variable in c++ code example Example: c++ print variable address printf("%p\n",(void*)&a);