c中变量的物理地址

Chu*_*Chu 3 c linux virtual-memory

When we print the address a variable in c program, as per my understanding it displays the virtual address because every time it comes same (except for auto variables). Is there any way we can know the physical memory address. I am using Linux 32 bit machine.

glg*_*lgl 11

没有简单易行的方法.

虚拟和物理地址之间的映射通过操作系统的内存管理单元进行,可以根据需要随意移动数据.

  • 特别是,如果包含该变量的页面已被换出,则变量甚至可能在特定时刻甚至没有物理地址......或者当您打印它时它可能具有地址X,但是当它被制作时它到屏幕上,你已经读过它,它现在有地址Y. (2认同)