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