指针规范化 [英] pointer normalization
问题描述
亲爱的,
可以解释指针规范化的含义
这里给出的
: -
http://c-faq.com/ansi/norml.html
Dear all,
can any one explain what is meant by pointer normalization
given here:-
http://c-faq.com/ansi/norml.html
推荐答案
sophia说:
sophia said:
亲爱的,
可以解释指针规范化的意思
这里给出的
: -
http://c-faq.com/ansi/norml.html
有可能指针值有多个对象
表示。如果p1和p2是指向同一个对象的两个指针,但是
不同的对象表示,那么p1 == p2需要产生1,所以
实现必须(表现得好像是)提供代码以标准化比较中使用的
指针值 - 即将一个或另一个
或两者转换为通用形式。 (这在MS-DOS时代非常普遍。)
请注意,同样的要求(确定两个
指针的相等性)不是强制性的在memcmp(& p1,& p2,sizeof p1)上。
-
Richard Heathfield< http://www.cpax.org .uk>
电子邮件:-http:// www。 + rjh @
谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>
Usenet是一个奇怪的放置" - dmr 1999年7月29日
It is possible for a pointer value to have more than one object
representation. If p1 and p2 are two pointers to the same object, but with
different object representations, then p1 == p2 is required to yield 1, so
the implementation must (behave as if to) supply code to "normalise" the
pointer values used in the comparison - i.e. to convert one or the other
or both to a common form. (This was perfectly common in MS-DOS days.)
Note that the same requirement (of identifying the equality of those two
pointers) is not imposed on memcmp(&p1, &p2, sizeof p1).
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
4月16日上午7:59,Richard Heathfield< r ... @ see.sig.invalidwrote:
On Apr 16, 7:59 am, Richard Heathfield <r...@see.sig.invalidwrote:
sophia说:
sophia said:
亲爱的,
Dear all,
可以解释指针规范化的意思
这里给出的
: -
can any one explain what is meant by pointer normalization
given here:-
http://c-faq.com/ansi/norml.html
指针值可能有多个对象
表示。如果p1和p2是指向同一对象的两个指针,>但是具有不同的对象表示,
It is possible for a pointer value to have more than one object
representation. If p1 and p2 are two pointers to the same object, >but with different object representations,
C中的对象意味着数据存储区域不是吗?
i没有得到你的观点,
同一个具有不同表现形式的对象?
Object in C means region of data storage isn''t it ?
i am not getting your point,
same object with different representations ?
4月16日,13:33,sophia< sophia.ag ... @ gmail.comwrote:
On 16 Apr, 13:33, sophia <sophia.ag...@gmail.comwrote:
4月16日上午7:59,Richard Heathfield< r。 .. @ see.sig.invalidwrote:
On Apr 16, 7:59 am, Richard Heathfield <r...@see.sig.invalidwrote:
*可以解释任何一个指针规范化是什么意思
这里给出: -
*can any one explain what is meant by pointer normalization
given here:-
> http://c-faq.com/ansi/norml.html
指针值可能有多个对象
表示。如果p1和p2是指向同一个对象的两个指针,
但具有不同的对象表示,
It is possible for a pointer value to have more than one object
representation. If p1 and p2 are two pointers to the same object,
but with different object representations,
C中的对象表示数据存储区域不是吗?
i没有得到你的观点,
*同一个具有不同表现形式的对象?
Object in C means region of data storage isn''t it ?
i am not getting your point,
*same object with different representations ?
在理智的架构上是不可能的,但请参阅
部分http://en.wikipedia.org/wiki/Intel_8086\"target =_ blank> http://en.wikipedia.org/wiki/Intel_8086
-
Nick Keighley
not possible on a sane architecture, but see the "Segmentation"
section of http://en.wikipedia.org/wiki/Intel_8086
--
Nick Keighley
这篇关于指针规范化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!