Which location address in a pointer refers to

What does the address in a pointer refer to, real address location in main memory or virtual address. Can it be configured.

And if it refers to virtual address , does Memory manager needs to convert this address to real address everytime it is accessed


This depends on your system and OS.

For a typical windows/linux user space application, the address is a virtual memory address. User space applications have no way of accessing the memory using physical addresses - that's one of the abstractions the OS gives each process.

The MMU(Memory management unit) does this translation for every memory access, and it's up to the OS to set up the corect mapping for your process.


If your system uses VM, then the address is virtual, if it doesn't, it isn't. This has nothing to do with either C or C++.


In other words, as a developer/programmer, you don't have to worry about whether the address is virtual or real. Pointer works perfectly in all the cases.

链接地址: http://www.djcxy.com/p/31662.html

上一篇: Java是否允许直接内存访问?

下一篇: 指针中的哪个位置地址指的是