As we all know, this only works if there is a pointee, which kind of gets back to rule number one.
众所周知,只有当有指针数据时,这个才起作用,这有点像第一条规则。
Number three, pointer assignment, takes one pointer and changes it to point to the same pointee as another pointer so after the assignment the two pointers will point to the same pointee.
第三条,指针赋值,使一个指针,指向另外一个指针所指向的数据,赋值过后,两个指针会指向,同样的数据。
Number one, the basic structure is that you have a pointer and it points over to a pointee, but the pointer and pointee are separate and the common error is to set up a pointer but to forget to give it a pointee.
第一,基本结构是,你有一个,指向数据的指针,但是那个指针和数据,是分开的,通常错误是声明了一个指针,但是没有指向一个数据。
Number two, pointer dereferencing starts at the pointer and follows its arrow over to access its pointee.
第二,指针非关联化从指针开始,通过它的箭头,来使用它的指针数据。
x >> Okay. I'll dereference the pointer x 42 to store the number 42 into its pointee.
>,好的,我废除这个指针,在指针数据中存储数字。
Now, dereferencing works on y and because the pointers are sharing 13 that one pointee, they both see the 13.
现在,解引用在y上起作用了,因为指针共享,同一个指针数据,它们两个都看到了。
> Okay. Well, this code allocates a new integer pointee and this part sets x to point to it.
>,好的,呃,这段代码分配一个新的整型指针数据,这部分让x指向它。
So, how do you allocate a pointee?
那么,你怎样分配一个指针数据?
It has a pointee.
它有指针数据了。
Say, Binky, I don't think dereferencing y is a good idea because, you know, setting up the pointee is a separate step and I don't think we ever did it.
你说,Binky,我不认为不关联y是一个好主意,因为,你懂的,调定指针数据是一个单独的步骤,我不认为我们这样做了。
y >> Yeah. We allocated the pointer y but we never set it to point to a pointee.
>,是的,我们分配了指针y,但是,没有指向任何数据。
So, doing a dereference on x follows the arrow to access its pointee.
那么,解除对应x的指针数据的,索引箭头。
Can you fix it so that y points to the same pointee as X?
你能使y指向x所指向的数据么?
应用推荐