• 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的拷贝,最后一行指明。

    哈佛公开课 - 计算机科学课程节选

  • temp This thing is going to be called temp and what are we putting there?

    这个东西被叫做,我们把什么放在里面?

    哈佛公开课 - 计算机科学课程节选

  • tmp The idea was to make a copy of res and 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,。

    麻省理工公开课 - 热力学与动力学课程节选

  • temp = *a This line of code here, temp gets *a.

    这一行代码。

    哈佛公开课 - 计算机科学课程节选

  • I'm going to call it temp and it doesn't matter where it ends up but conceptually it's in this frame.

    我把它称作temp,不管它以什么结束都无所谓,它这个框框里。

    哈佛公开课 - 计算机科学课程节选

  • Y Why don't I say int temp gets X. Let's say Y oh, sorry, X gets Y and then Y gets temp, this 2 would fail.

    为什么我不说明,int,temp,=,X,让我们说明,哦,对不起,X=Y,然后,Y=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,里面是什么?

    哈佛公开课 - 计算机科学课程节选

  • 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的一块内存。

    哈佛公开课 - 计算机科学课程节选

  • 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或;,所以他刚才做了所有的工作,就是那样。

    哈佛公开课 - 计算机科学课程节选

  • 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,或者诸如此类的例子,这些变量在内存中紧随其后。

    哈佛公开课 - 计算机科学课程节选

  • 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,然后还有。

    哈佛公开课 - 计算机科学课程节选

  • So this thing here that starts with slash temp, that's pretty useless information.

    错误信息从/tmp开始,其实这是无用信息。

    哈佛公开课 - 计算机科学课程节选

  • > Initially, how come I don't have declare temp as what?

    >,最初,为什么我不声明temp成什么?

    哈佛公开课 - 计算机科学课程节选

  • temp temp There's temp.

    很简单。,Well,,temp,is,easy。,那里是。

    哈佛公开课 - 计算机科学课程节选

  • Well, what's in temp?

    好的,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,所以现在我交换这些值。

    哈佛公开课 - 计算机科学课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定