- 论坛徽章:
- 26
|
说指针就是地址是不对的吧, 看看ISO C99的说明, 里面并没有说指针一定是地址. 可能某种奇怪的编译器对指针的实现就不是地址呢?
A pointer type describes an object whose value
provides a reference to an entity of the referenced type.
下面的对指针的回答, 我觉得是解释的最好的. 我贴出来
The C standard does not define what a pointer is internally and how it works internally. This is intentional so as not to limit the number of platforms, where C can be implemented as a compiled or interpreted language.
A pointer value can be some kind of ID or handle or a combination of several IDs (say hello to x86 segments and offsets) and not necessarily a real memory address. This ID could be anything, even a fixed-size text string. Non-address representations may be especially useful for a C interpreter.
作者地址 http://stackoverflow.com/questio ... ot-a-memory-address |
评分
-
查看全部评分
|