• At least you maybe finding that and if not when you look back at the code you then have written you'll realize that in fact it just requires a few lines of code.

    至少你会发现这一点,不然的话,在你写完代码返回去,看的时候你会意识到,实际上它只需要几行代码

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

  • So there's a return branch on every possible path through the code. And that's valuable, it's something you want to think about as your right your own.

    所以代码中每条可能的路径,都会有一个返回值分支,这是非常有价值的,当你自己写程序的时候也应该考虑这件事。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So, after the second line for code here char * s1 gets the return value of get string this is what the state of our world looks like.

    在第二行之后,这个代码char,*s1,等于GetSting的返回值,这就是它看起来的状态。

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

  • OK. Note, by the way, if I chase through each possible path, like there's some IFs in here, if there's some places to go, at least in this piece of code, every possible path through this code ends in a return. And that's a good programming discipline, to make sure that happens.

    注意一下,如果我跟进每一条可能的路径,像是这里的,起码在这段代码中就有很多走向,这段代码中的每一条可能路径,在结尾都会返回一个值,这就是一条很好的编程定律,请确保这样做。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • X I'm passing an X, and yet I'm also assigning the return value to X. So just intuitively what's going to be the effect of this one line of code?

    我传一个X,之后我把返回值赋值给,很明显,这一行代码,将会产生什么作用?

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

  • So this line or these lines of code up here are arguably constant time steps to say if N is less than 2 in return, that it will always take maybe one step, maybe two steps, some number of fixed CPU cycles.

    如果N小于2并返回,那么这些行所对应的代码,通常只需要执行一步,或者两步,具体数字与CPU周期有关。

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

  • Now, the one that we're most interested in ANS is the one where, in fact, it gets out ANS, so you see down here in the code, there's a spot where it's going to return the value of ANS, which is what we want, right? That's the thing that holds the value that we intended to have.

    现在我们最感兴趣的是这个,事实上它返回的是,所以你看这段代码,在这里返回ANS值,也就是我们想要的,对吧?,它就承载了我们想得到的值。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • - So now if Christiana doesn't actually -- if either programmer or who's programming these little puzzle pieces, don't actually do anything with this return value, and I call, get int, she wants to hand this piece of paper -- to me, but if I don't actually assign -- no, no, I just messed up the demo.

    现在如果Christiana没有-,如果程序员或谁在编写这段代码,不要对这个返回值做任何事情,我调用GetInt,她把这张纸给我,但是如果我没有赋值-,不,不,我刚才把这个演示搞乱了。

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

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

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

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