请在“关于指针操作的注释”中查看我的网页内容 [英] Please check the content of my web page on 'A note on Pointer Operation'
问题描述
它位于 http://211.30.198.135/pointer_operations.html 。我希望对此进行审核以确保它们是正确的。
我不确定复制/粘贴是否会正确显示但内容为:
关于指针操作的说明
我们从表格开始:
对象地址
xp& ; xp
* pp
表1.
我们可以更清楚地说明表中包含的关系我们也访问该表:
对象地址对象地址
xp& xp * pp
* pp xp& xp
表2.
我们可以从中收集以下作业:
xp = * p; & xp = p;
* p = xp; p =& xp;
我们可以立即看出这种关系是可交换的,即xp = * p和* p = xp或者& xp = p和p =& xp。
同样出现& xp =& * p = p和& * p =& xp = p。基本上它是说& * p = p。那么*& xp呢?是的,类似地我们推断出*& xp = * p = xp和* p = *& xp = xp,这意味着*& xp = xp。所以我们确认& xp = p和* p = xp。
最后,操作& *等同于*&。
It is at http://211.30.198.135/pointer_operations.html. I want to get this reviewed to make sure that they are correct.
I''m not sure whether copy/paste will show up correctly but the content is:
A note on Pointer Operation
We start with the table:
Object Address
xp &xp
*p p
Table 1.
We can illustrate the relationship contained in the table clearer if we also visit the table:
Object Address Object Address
xp &xp *p p
*p p xp &xp
Table 2.
We can gather from this the following assignments:
xp=*p; &xp=p;
*p=xp; p=&xp;
We can immediately see from this that the relationship is commutative, namely that xp=*p and *p=xp or that &xp=p and p=&xp.
Also it occurs that &xp=&*p=p and &*p=&xp=p. Basically it is saying that &*p=p. What about *&xp? Yes, similarly we deduce that *&xp=*p=xp and *p=*&xp=xp, which means *&xp=xp. So we confirm that &xp=p and *p=xp.
Lastly, it also occurs that the operation &* is equivalent to *&.
推荐答案
Logan Lee< Lo ********* @ student.uts.edu.auwrites:
Logan Lee <Lo*********@student.uts.edu.auwrites:
这是在 http://211.30.198.135/pointer_operations.html。我希望对此进行审核以确保它们是正确的。
我不确定复制/粘贴是否会正确显示但内容为:
关于指针操作的说明
我们从表格开始:
对象地址
xp& ; xp
* pp
表1.
我们可以更清楚地说明表中包含的关系我们也访问该表:
对象地址对象地址
xp& xp * pp
* pp xp& xp
表2.
我们可以从中收集以下作业:
It is at http://211.30.198.135/pointer_operations.html. I want to get this reviewed to make sure that they are correct.
I''m not sure whether copy/paste will show up correctly but the content is:
A note on Pointer Operation
We start with the table:
Object Address
xp &xp
*p p
Table 1.
We can illustrate the relationship contained in the table clearer if we also visit the table:
Object Address Object Address
xp &xp *p p
*p p xp &xp
Table 2.
We can gather from this the following assignments:
^^ ^^^^^^^^^
我不确定这里''赋值'这个词的适用性,以及我是否应该写A == B而不是A = B.
^^^^^^^^^^^
I''m not sure about the approriateness of the word ''assignments'' here and also whether I should really write A==B rather than A=B.
>
xp = * p; & xp = p;
* p = xp; p =& xp;
我们可以立即看出这种关系是可交换的,即xp = * p和* p = xp或者& xp = p和p =& xp。
同样出现& xp =& * p = p和& * p =& xp = p。基本上它是说& * p = p。那么*& xp呢?是的,类似地我们推断出*& xp = * p = xp和* p = *& xp = xp,这意味着*& xp = xp。所以我们确认& xp = p和* p = xp。
最后,操作& *也相当于*&。
>
xp=*p; &xp=p;
*p=xp; p=&xp;
We can immediately see from this that the relationship is commutative, namely that xp=*p and *p=xp or that &xp=p and p=&xp.
Also it occurs that &xp=&*p=p and &*p=&xp=p. Basically it is saying that &*p=p. What about *&xp? Yes, similarly we deduce that *&xp=*p=xp and *p=*&xp=xp, which means *&xp=xp. So we confirm that &xp=p and *p=xp.
Lastly, it also occurs that the operation &* is equivalent to *&.
Logan Lee< Lo ********* @ student.uts.edu.auwrites:
Logan Lee <Lo*********@student.uts.edu.auwrites:
它位于 http://211.30.198.135/pointer_operations.html 。我希望对此进行审核以确保它们是正确的。
我不确定复制/粘贴是否会正确显示但内容为:
关于指针操作的说明
我们从表格开始:
对象地址
xp& ; xp
* pp
表1.
我们可以更清楚地说明表中包含的关系我们也访问该表:
对象地址对象地址
xp& xp * pp
* pp xp& xp
表2.
我们可以从中收集以下作业:
xp = * p; & xp = p;
* p = xp; p =& xp;
我们可以立即看出这种关系是可交换的,即xp = * p和* p = xp或者& xp = p和p =& xp。
同样出现& xp =& * p = p和& * p =& xp = p。基本上它是说& * p = p。那么*& xp呢?是的,类似地我们推断出*& xp = * p = xp和* p = *& xp = xp,这意味着*& xp = xp。所以我们确认& xp = p和* p = xp。
最后,操作& *也相当于*&。
It is at http://211.30.198.135/pointer_operations.html. I want to get this reviewed to make sure that they are correct.
I''m not sure whether copy/paste will show up correctly but the content is:
A note on Pointer Operation
We start with the table:
Object Address
xp &xp
*p p
Table 1.
We can illustrate the relationship contained in the table clearer if we also visit the table:
Object Address Object Address
xp &xp *p p
*p p xp &xp
Table 2.
We can gather from this the following assignments:
xp=*p; &xp=p;
*p=xp; p=&xp;
We can immediately see from this that the relationship is commutative, namely that xp=*p and *p=xp or that &xp=p and p=&xp.
Also it occurs that &xp=&*p=p and &*p=&xp=p. Basically it is saying that &*p=p. What about *&xp? Yes, similarly we deduce that *&xp=*p=xp and *p=*&xp=xp, which means *&xp=xp. So we confirm that &xp=p and *p=xp.
Lastly, it also occurs that the operation &* is equivalent to *&.
我不能很好地设置apache所以我把这些东西放在 http://www.geocities.com/logan.lee30...perations.html 。
12月16日上午1:55,Logan Lee< Logan.W .... @ student.uts.edu.auwrote:
On Dec 16, 1:55 am, Logan Lee <Logan.W....@student.uts.edu.auwrote:
>
最后,操作& *等同于*&。
>
Lastly, it also occurs that the operation &* is equivalent to *&.
在学术意义上,这可能是真的,但你需要小心。
考虑:
>
char c =''c'';
''c''== *& c; / *好的* /
''c''==& * c; / *错误* /
IOW,如果你想到*和&作为运营商在
适当的空间,然后& *和*&是等价的。
然而,在一个实际的实现中,它不是这样的,因为实际的域/ codomains不匹配,所以
。
将*视为所有
类型指针对象空间的运算符,&作为运营商
所有对象的空间。很明显,如果c不是指针,* c
是未定义的,所以只要c是一个对象,就会定义*& c
,
但是& * c仅在c为对象时定义
类型指针。
In an academic sense, that may be true, but you need to be careful.
Consider:
char c = ''c'';
''c'' == *&c; /* okay */
''c'' == &*c; /* error */
IOW, if you think of * and & as operators on the
appropriate space, then &* and *& are equivalent.
However, in an actual implementation, it aint so,
since the actual domains/codomains don''t match.
Think of * as an operator on the space of all
objects of type pointer, and & as an operator
on the space of all objects. Clearly, *c
is undefined if c is not a pointer, so *&c
will be defined as long as c is an object,
but &*c is only defined if c is an object
of type pointer.
这篇关于请在“关于指针操作的注释”中查看我的网页内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!