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.
也就是。
In temp. So that means at the end of that first line of code just as before the value of 1 ends A up in a variable called temp because we said go to A and I look around, oh, there's A, what's there?
在temp中,在第一行代码的末尾,值1最终到了叫做temp的变量中,因为我们指明了定位到,并且四处查看,哦,这里是A,里面是什么?
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,。
So A gets 1, B gets 2, now the swap function itself starts executing line by line; so I declare a chunk of memory called temp.
所以A等于1,B等于2,现在swap函数自己开始,一行一行地执行,所以我声明了,叫做temp的一块内存。
So the value of 2 is here so now *b gets temp so what goes here?
那么数值2在这里,*b=temp,那么这里是什么?
foo Well, if main has any local variables X or Y or temp or foo or bar, or whatever the case may be, those variables come next in memory.
好的,如果main函数有本地的变量X或Y或temp或,或bar,或者诸如此类的例子,这些变量在内存中紧随其后。
应用推荐