To what extent is it acceptable to think of C++ pointers as memory addresses?

后端 未结 12 1133
难免孤独
难免孤独 2020-12-10 10:18

When you learn C++, or at least when I learned it through C++ Primer, pointers were termed the \"memory addresses\" of the elements they point to. I\'m wondering to

12条回答
  •  Happy的楠姐
    2020-12-10 10:42

    Pointers are memory addresses, but you shouldn't assume they reflect physical address. When you see addresses like 0x00ffb500 those are logical addresses that the MMU will translate to the corresponding physical address. This is the most probable scenario, since virtual memory is the most extended memory management system, but there could be systems that manage physical address directly

提交回复
热议问题