Now, we're not quite there because now we have two copies *b=temp of 2 so the last line of code says *b gets temp.
现在,我们还没有达到目的,因为现在我们有两个2的拷贝,最后一行指明。
tmp The idea was to make a copy of res and temp.
也就是。
I'm going to call it temp and it doesn't matter where it ends up but conceptually it's in this frame.
我把它称作temp,不管它以什么结束都无所谓,它这个框框里。
The temperature though at two is the same as it was at one, T1 so it's still a temp at T1, and this temperatures is at T2.
但是2和3的温度,是相同的,这是,这是T2,。
foo So everything is literally going back to back to back and so foo, similarly, if you have any local variables, like temp, it then goes here.
所以所有东西都背靠背紧邻着,所以对于,类似的,如果你有任何局部变量,像temp,它前进到这里。
Y He's not returning A or B or temp, and definitely not X or Y; so he just did all of this work and yet that's it.
他不会返回A或B或temp,肯定也不是X或;,所以他刚才做了所有的工作,就是那样。
No. Because A and B and even temp they were by nature local or temporary variables.
不会,因为a和b还有temp,他们是局部的,临时的变量。
So the value of 2 is here so now *b gets temp so what goes here?
那么数值2在这里,*b=temp,那么这里是什么?
temp It has A, it has B, and then it also has temp.
有A,有B,然后还有。
> Initially, how come I don't have declare temp as what?
>,最初,为什么我不声明temp成什么?
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,所以现在我交换这些值。
应用推荐