But I want you to see now what happens if I use this. Let's bind x to the value of 3.
但是我想你看看如果我这么用的话,会发生什么。
I fully understand the value of what you are driving at, but frankly, the narrative as it now stands simply will not support a more general or hopeful conclusion.
但你的提议太含糊不清,说实话,你说的,无助于更好的结局。
All right, c p 1 dot y, x I've said assign that to the value 2, 2,0. So now c p 1 has inside of it an x and y value.
一个特定的版本,我现在命名了一个内置变量,并给它赋值了,我刚刚做的也就是给它。
Now, I mentioned this other sentinel value a while back.
现在,我刚才提到了这个标记值。
If I want to get out right now the versions of these things, I can ask what's the value of c p 1 x, and it returns it back out.
你可以在那里看到那些,代表笛卡尔坐标点的东西,如果我想要得到现在,这个类的版本的东西的话。
Right now it's a simple template, but it's a template for creating what a class looks like, and I now have an x- and y- value associated with each instance of this.
那么大家明白了为什么,我说类是一个模板了,对不对?,现在它只是一个简单的模板,但是它是一个用来-,创建形成一个类的模板。
Well, A has to get whatever is in B. So now I'm clobbering, as they say, this value here, and at this point in the story, this is not good.
好的,A将获得B中的数据,现在我把这个值删掉,在这个地方,这是不好的。
And actually, if I don't want to clobber, as we say, overwrite the value of my variable, ; I could declare another one and store the return value in Y; Y so now I have two ints in memory; X and Y, 3 one with two, one with three.
实际上,如果你不想彻底清除,像我们说的,覆盖那个变量的值,我可以申明另一个变量Y,并在Y中保存那个返回值;,现在内存中有两个int数,X和,一个的值为2,一个为。
And so this time when you hand it back, this value, I store it in -- we'll say X, and now we actually have retained the value.
这次当你拿回这个值时,我把它存储在X中,现在我们把这个值保存了。
I now assign X the value of 1.
现在我把X赋值为。
It's reasonable because it's meant TMP for temporary purposes just to call it temp or T-M-P for short, X and I can define temp as -- why don't I set it as equal to X, initially, because now that I've stored X in a separate chunk of memory, I can now change its value and then I can say Y gets, not X, but temp, and so now I've actually swapped these values.
这是合理的,因为它是为,暂时的目的,只要叫它Temp或简称它为,我可以定义temp为--为什么我不把它设定为等于,最初的,因为现在我把X存储在一个单独的内存块中,我现在可以改变它的值,然后我说Y等于,不是X,而是temp,所以现在我交换这些值。
应用推荐