• And notice because I have just one line of code inside of each of these branches, what have I clearly omitted?

    请注意因为我在每个分支中只有一行代码,显然地我省略了什么?

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

  • But there's a key line of code that I lost over a moment ago and that was this one here.

    但是我刚才漏了一行关键的代码,就是这里的这一行

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

  • Let's assume, for sake of argument, the thing I'm looking for is bigger than this. In that case, I'm going to throw away all of this, I'm going to hit that bottom line of that code.

    让我们假定不是,假定要找的元素,比这个大,在这样的情况下,这些都擦掉,我要运行到代码的最后一行

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

  • It's just a series of lines of code.

    那只不过是一系列一行行的代码

    耶鲁公开课 - 死亡课程节选

  • I want the function, which is a little tool, a line of code I can include in my own programs and generally those tools live in sections two or three of the manual.

    我想要一个函数,那是一个小工具,在我程序中可以包含的一行代码,通常这些工具在手册的第二节,或第三节。

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

  • We could certainly implement this much more efficiently by just writing this one line of code, but, again, the key here is to take this step toward decomposing our code into chunks of code.

    我们可以写这一行代码,使代码的执行更有效率,但是,这个关键字用来把我们的代码分解,成一段段的。

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

  • It's deliberate that a lot of the examples in lecture are fairly short and bite-size so that you can actually focus on pulling out the key ideas without getting distracted by line and lines of code.

    很多的演讲中的例子,是短小的,因此你们可以集中于提取其中的主要思想,而不是被一行行的代码给分心。

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

  • Right. So similarly, if you've got one line of code with a semicolon at the end saying, this is the end of the statement, it doesn't really make sense to continue that conversation to try to continue conceptually that puzzle piece with curly braces.

    对的,类似的,如果你得到了一行代码,后面有一个分号,标志语句的结尾,这就没有意义来继续,那个会话来尝试对那段代码,使用花括号。

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

  • So I actually don't need the curly braces because I only have a single line of code.

    所以我实际上不需要那个花括号,因为我只有一行代码

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

  • It's okay. So this first line of code, I will get it started but then I'm gonna have you take over and actually instruct Philip what to do here.

    一行代码就从这里开始,接下来我会让你,接管并指导飞利浦。

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

  • So this first line of code, and some of this again we'll be rehashed but at least you can delight in the awkwardness that is this demonstration.

    因此,第一行代码,有些地方我们需要重新处理下,但至少看到这次,笨拙的演示你会很高兴。

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

  • So, what are we really doing in this line of code here?

    那么,这一行代码是干什么的呢?

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

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

    一行代码

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

  • The curly braces to encapsulate one or more lines of code.

    花括号压缩了一行或多行代码

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

  • stdio h This file here is called standard I/O or stdio.h and this is just another text file someone else wrote many years ago and by using that line of code there, I'm telling the computer, give me acces to this code that this other person wrote that's in that file.

    在这里的头文件称为标准输入输出文件或,这是由某位前人编写的文本文件,我们只需要刚才所述的一行代码,就能告诉电脑,让我连接到,这个前人在那个文件中写的代码

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

  • And what line of code am I on now?

    那我现在在伪代码的哪一行呢?

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

  • So what does this line of code do?

    一行代码是干什么的啊?

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

  • And that first one is init this kind of interesting thing, it's two underbars, init, and two underbars. Underscores, I guess is the right way to say it, not underbars.

    然后第一行代码是很有趣的东西,这是两个下划线,然后再有两个下划线,下面的划线,我认为应该这么说,而不是下划线。

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

  • Well, the first line of code, I'll fix the purple next time around so it's more legible.

    一行代码,我用紫色标记,这样增加了可读性。

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

  • You can imagine having many lines of code where all of a sudden your closed quote is on the next line all the way on the left.

    你可以想象一下,这有很多行代码,突然一个后引号,移到下一行最左边。

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

  • Found where the statement is, and then fixed it.

    找出来那一行代码

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

  • Well, just this line of code here.

    看到这一行代码

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

  • Even though this looks like what the out-- this looks like the output you want, "Oh, hi world" and then everything else should go on the next line.

    即使这样看起来和你-,想要的输出“Oh,hi,world“没啥两样“,仅仅只是把其他代码往下挤了一行

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

  • So really, the rule of thumb if you think back to Scratch is -- that any time you write a statement -- -- something that does something in one line of code -- you generally need the semicolon there.

    实际上,根据经验,你们回忆一下在Scratch中,任何时候你们写一条语句-,处理一些操作的一行代码-,你们通常需要在那里加个分号。

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

  • include stdio h The next line of code says include standard io.h which just as a little sanity check contains among other things, printf.

    接着的一行代码写着,这个库文件包含一些我们常用的函数,譬如,printf函数。

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

  • 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,之后我把返回值赋值给,很明显,这一行代码,将会产生什么作用?

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

  • The standard library, that first line of code, it's not strictly necessary but any time you use a function, a tool that someone else wrote that lives in that so called library, you do need that include line as we'll see.

    标准库函数--第一行代码,严格来说,不是每次都要写的,但是一旦你调用某个别人写,的函数,而这个函数又恰巧位于标准库里面,你就要像我们看到的这样,把它include进去。

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

  • But what looks like this orange block as of now in Scratch, add orange to your so called inventory, well, it's gonna take at least two lines of code in C to actually create the inventory array with this first line and then put something like the word orange inside of it.

    就好比Scratch里面橘色的这一块,把“桔子“加到所谓的“清单“里面去,在C语言中至少需要两行代码来实现,第一行代码创建一个货单数组,第二行就需要把“桔子“放进去。

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

  • As an aside, if you ever just have one line of code that you want to execute, one puzzle piece in Scratch terminology, ; you actually don't need the curly braces; you only need the curly braces if you have two or more lines of code that you want to execute if that condition is true.

    此外,如果你只有一行代码,需要执行,在Scratch,术语中叫做,一句代码,你就不需要使用花括号了;,如果那个条件成立,你有两行或更多行的代码时需要执行时,你就需要花括号。

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

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

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

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