I can print the address of a pointer by using the following code
#include<stdio.
int main(){
int *q =(int*) malloc(4);
printf("%x
",q);
}
When i execute the following code a hexadecimal value is printed. Is it the virtual address or the physical address of variable q on heap? If it is virtual how should i print the other?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…