• Well, all this time int on the blackboard I always draw an int as a square.

    嗯,向来,我在黑板上用一个正方形表示一个。

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

  • int A >> How can I name it int A but it works for?

    >,我怎么样命名它为,但是它是有什么用的呢?

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

  • When you think about an int or a float or a dictionary or a list, you knew that there were functions that operated on them.

    当你想到整型,浮点型,或者链表时,你知道可以用函数去处理他们,但是当你传递一个参数,例如链表。

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

  • I get the int and store it in n. The switch statement takes inside its parenthesis an int or a char or some primitive type.

    我得到一个整数并把它存储,到n中,switch语句的圆括号里可以是一个整数,或者一个字符或其他的基本类型。

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

  • int A Well, one, function has called swap, takes one int called A, printf followed by another int called B, and as we've seen with print F, if you have multiple arguments, you separate them by commas.

    好的,函数叫做swap,一个参数是,另一个参数是int,B,我们看到的,如果你有好几个参数,把它们用逗号分开。

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

  • float So thus far, when we've defined -- declared an int and a float, 2 and so forth, we just put one value in there, the number 2, the number 3.14, just one single value.

    至此,当我们定义--声明一个int,和一个,等等,我们只要在那里放置一个值,数字,数字3,14,只有一个值。

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

  • It may mean something different and this is sort of just stupid re-use of syntax although frankly it wouldn't really be much fun to have yet a symbol so they went with the same symbol which is pretty reasonable in the context *a of a function prototype this just means *a expect A to be the address of an int and expect B to be the address of an int.

    这里的意思有点不同,这是为了重使用的目的,虽然这个符号没有什么意义,所以在函数原型中,他们就使用了相同的符号,这只是表示,期望,是一个int型的地址,期望b是一个int型的地址。

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

  • Well, if intuitively the problem is the result of dividing an int by an int, surely a solution is: "Don't do that," right?

    好的,直观地看,如果那个问题的原因是因为整型数除以整型数的话,无疑有个解决方案是:“不要那样做“,是吗?

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

  • Well, you can implement this in a few different ways but here's one approach that uses some int counter=0 of the syntax we just looked at, int counter equals 0.

    当然,你可以有好几种方法来实现这一目标,但是其中一种方法,只需要用到我们刚刚看到的那种语法。

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

  • Then I'd be multiplying a float by 5, so that's a float times an int.

    然后我们把这个浮点数乘以,那是浮点数乘以整型数。

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

  • So for now assume it's got to be an int or a char.

    所以现在假使它是一个整数或字符。

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

  • Instead divide an int by a floating point value.

    我们用一个整型数除以浮点数。

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

  • So we've seen a lot of this, for instance, in office hours and maybe you too have done or are currently doing this, but there's a problem with writing a statement, like print F, followed by, get int, alone.

    我们看过很多这个,例如,在办公时间,可能你们做完了或还在做这个,但是写语句的时候有个问题,就像printf,紧跟着的是GetInt,单独的。

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

  • - We know from Wednesday if -- briefly -- that there's this thing called a "char" or "char," depending on how you want to pronounce it, which is just a single character but where there's also an int.

    我们知道从周三起--简单说下-,我们有个叫做“char“或“char“,看你们怎么读它了,那代表一个单一的字符,但那里会有个整型数与之对应。

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

  • Is there a key word like int or char double with which you can represent a 1024-bit value?

    有一个像int,char,double这样的关键字,用来表示一个1024位大小的数值呢?

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

  • Now at this point in the story, I've got a variable called n. I've stored it in int.

    现在这个故事的这里,我获得了一个变量n,我把它存储成int型的。

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

  • So this is something that we would call an integer, or an INT. And this is something we would call a floating point, or a float.

    这是我们称之为integer的类型,或者INT,这是我们,称为浮点数的类型,或者浮点。

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

  • Now you have a set of parentheses as we'll see int i=0 in actual code and then I have int I equal 0.

    你将会在实际的代码中看到一对圆括号,比如,我们让。

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

  • - And then I divide by an int -- that's okay because so long as you have a float involved at some point early on, you're okay.

    然后我除以一个整型数-,那是可以的因为现在为止,我们在之前已经,引入了一个浮点数,你是对的。

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

  • And we'll see if you try to mess with our functions by providing a string when we want an int, or providing an int when we want a string, you may very well get yelled at and the user will have to retry.

    我们可以看到,如果你尝试打乱我们的函数,当想要一个int数时我们提供sting型,或者,当想要一个sting数时我们提供int型,你可能会被吼叫,然后用户不得不重新尝试。

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

  • So this declares an integer, a variable of type int called I, 0 and initializes it to zero.

    所以这里声明了一个整型数,一个叫做I的整型变量,把它初始化为。

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

  • So unlike an int, this is the type of number that can have numbers after a decimal place.

    所以,不同于int,这个类型的数字,可以有小数位。

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

  • So this line here declares a variable, just storage space called "x" and it's of type "int," which means an integer has to go in it.

    这里的这条线声明了一个变量,一个叫做“x“的存储空间,它的类型是“int“,意思是里面存储的是整数型的数据。

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

  • A few of you were probably wondering, "Well, how do I actually get the int from the user?"

    有的同学可能想知道:,“我们怎么通过用户获得那个int数值“

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

  • If you want to do the opposite process, you simply "cast to an int from a char."

    如果你想做相反的转换,你就告诉计算机,“把那个char型数据转换成int型处理“

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

  • i So I have up here at the top of my program a variable called i 0 of type int, and I have to initialize it up here to zero.

    所以在程序的顶端我有一个int类型的变量,我需要把它初始化为。

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

  • So there's no mention of int, and yet we've been saying for the past couple of lectures, that anytime you declare a variable, you absolutely have to specify its type.

    这里没有提及int,我们在前几个演讲中,一直讨论的东西,任何时候你声明一个变量,你必须指定它的类型。

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

  • int So whereas before I mentioned int, turns out if you wanna put a string in a variable, you have to say this is a string.

    先不管我之前提到的,如果你想把一个字符串赋给某个变量,那你必须事先声明这个变量是string类型的。

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

  • A If you want to convert a number like 65 to the letter A, you just have tell the computer "cast that int to a char."

    如果你要把一个像65这样的数字转换为字母,你只需要告诉计算机“把那个int型数据转换成char型处理“

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

  • I'm going to call it x and how do I make a pointer to an int?

    我把它叫做x,我怎样声明一个int型指针?

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

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

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

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