OK, as I said, I want equality in the case of points to be, are the x- and y- coordinates the same?
好,正如我所说,我想要这个例子中的,点相等的意思是?
So this first little piece of code right here says, ok you give me 2 points, I'll create another 1 of these lists and I'll simply take the x, sorry I shouldn't say x, I'm going to assume it's the x, the x-values are the two points, add them together, just right there, the y-values, add them together and return that list.
好,为了来认识到这一点,让我们来看一个简单的小例子,在你们的课堂手册上,你可以看到我写了一个小程序,它假设我得到了,这些点中的一些,我想对它们做一些操作,例如我想把它们加到一起,那么这里的第一小片,代码的意思是,好给我两个点,我会再创建一个数组。
y A square it's called X, another square it's called y and now this time I'm doing pointers to int not points to char.
一个叫做x,另外一个叫做,这一次是int型指针,不是char型指针。
j points away from the origin in the y direction.
从原点指向 y 轴正方向
And I originally decided I was going to have as points, it's going to have internal values of an x and a y.
写了一堆代码,然后我以开始决定,是要把值放到点里面的,点有内部的x坐标和y坐标。
Now, y points to the same place as X. So, wait now y is fixed.
现在,y和x指向同一东西,所以现在y被修正了。
Can you fix it so that y points to the same pointee as X?
你能使y指向x所指向的数据么?
应用推荐