• Expect the address of an int but here in the context of the function itself inside the curly braces, it means go to that address.

    一个整型数的地址,但是在函数,大括号中的环境中,意思是定位到那个地址。

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

  • You can put a variable there, and because it's not encapsulated in curly braces, as we just discussed, that essentially means it's accessible everywhere in that file.

    你可以加入一个变量,因为它不是封装在花括号里,就像我们刚才讨论的,本质的意思是它可以在文件的所有地方,都可以被访问到。

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

  • Yep. Are you telling me I want parens there and not, and not braces?

    现在你告诉我我在这里要不要打括弧啊,需不需要大括弧?

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

  • In fact, this example would compile because you can use curly braces in this way to encapsulate lines of code, but realize for now, that, not good.

    实际上,这个例子可以编译,因为你可以用这种方式来压缩代码行,但是请认识到,那个,不太好。

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

  • So the open curly brace followed by the closed curly brace means everything inside of these curly braces should get executed, but only if that first condition is actually true.

    所以左花括号后面跟着,右花括号,这意味着花括号里面所有的代码,都应该是要被执行的,但只有当第一个条件是正确的。

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

  • And that's fine, because inside of curly braces can you redeclare variables with the same name if you intend to quote unquote shadow the previous variable.

    那是可以的,因为,在花括号里面,你可以重新定义一个,相同名字的变量,如果你想引用之前的变量。

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

  • So let me challenge you with this: inside of these curly braces where I have put a comment with slash slash -- a "comment" means nothing here gets compiled, it's just for the human to read.

    让我用这个来挑战你们:,在这些花括号里面,我通过双斜杠写入了一个注释,-一条“注释“在这里不会被编译,它只是用来我们阅读的。

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

  • So when you define a function, you have, as we've seen these curly braces, that define all ; of the code that's associated with that function; open curly brace code, close curly brace, that is the function.

    当你定义一个函数,就像我们看到的这些花括号,定义了与,那个函数相关的所有代码;,左花括号,代码,右花括号,这就是一个函数。

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

  • 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.

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

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

  • And then there are some stupid syntax like curly braces and semicolons that initially are kind of annoying because you have to remember where all this junk goes.

    还有一些像大括号和,分号之类的愚蠢语法,最初是很讨厌的,因为你需要记得它得放到哪里。

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

  • So if you do include it up top, the subsequent lines, even if you have these curly braces, are not, in fact, going to help you.

    所以如果你在前面就包含它,后面的代码,即使你有这些花括号,实际上也没有用了。

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

  • The curly braces ensure that everything is logically clustered where it should be.

    花括号确保了,逻辑上是聚集在一起的,它本来也应该这样。

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

  • Absolutely, by functions, but you can also create local scope with curly braces.

    绝对的,是由函数定义的,但是你也可以用花括号来创建局部范围。

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

  • That's why it's using set braces, so don't worry about that.

    这也是为什么字典用了集合的括号的原因,因此对这一点不用担心。

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

  • And then what I get to do inside the curly braces is literally line by line enumerate the cases that I want to apply to the following code.

    然后我们在花括号中要做的是,逐行地列举接下来我想要,应用的代码。

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

  • It ultimately evaluates that line of code but just once the stuff inside the curly braces, but the semicolon on the end, essentially has the effect of this.

    它最终执行了那行代码,但是只有一次,当那个东西在花括号里,分号放在后面,本质上影响了这个循环。

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

  • But for now, it's probably simpler just always use the curly braces just to get into the habit.

    但是现在,简单起见,你可以,养成每次都使用花括号的习惯。

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

  • So again immediately on first glance, a little more arcane, there are some distracting details, these curly braces, the semicolon, the quotation marks.

    第一眼扫过去,是不是有点神秘,有点繁琐,还有一些莫名其妙的大括号,分号和引号呢。

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

  • And so what I was hinting at earlier when you put semicolons in the wrong place, and then proceed to have curly braces around arbitrary lines of code, you're creating an even more local scope there, which is generally not the right intended behavior.

    在之前我暗示了,当你把一个分号放在错误的地方时,然后开始用花括号,括上任意行的代码,你在那里创建了一个局部范围,那个不是故意的行为。

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

  • > Are scopes defined by curly braces or by functions?

    >,范围是由花括号定义的还是函数定义的?

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

  • Everything inside of the curly braces is the code I am writing.

    所有在大括号里面的代码都由我们自己编写。

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

  • Inside the curly braces is this program's code, what am I doing?

    在花括号里是这个程序的代码,我在做什么?

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

  • Are -- is scope defined by curly braces or by functions?

    范围是由花括号定义的还是函数定义的?

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

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

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

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

  • They only mean go there when you're inside the curly braces.

    只有在花括号里时,意思才是定位到那里去。

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

  • So we don't need the curly braces.

    所以我们不需要那个花括号。

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

  • But to translate this now to a language C, you've got some curly braces, you got an if, some parentheses, but now we're just building on some of the syntax we introduced before.

    如果把它转换成C语言,你又会看到一些大括号啊,if啊,圆括号啊等等,我们只是借助,之前学过的语法规则。

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

  • The curly braces are then the C's way of kind of making a puzzle piece that looks like this so you can put stuff inside.

    花括号是C语言的一个方式,用来做一个像这样的程序块,所以你可以把代码写在里面。

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

  • So we have if, and that is followed by, I'm going to use angle braces here just to indicates something goes in here, some test followed by a colon.

    那么我写了if,后面跟着,我这里会用一个角括号,来代表这里有些东西,冒号后面跟着一些测试。

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

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

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

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