• And we've only just begun using it, but it has just a bunch GetInt GetString GetDouble of very useful functions like GetInt, GetString, GetDouble, And so as those names imply, you can just cull these functions with no arguments and you'll get back that data type based on its name.

    我们刚开始使用了它,里面有很多的,有用的函数,像,所以,那些名字暗示,你可以挑选这些,没有参数的函数,然后你可以通过它的名字,获取他们的数据类型。

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

  • GetString >> You can't find GetString.

    >,找不到。

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

  • that redundancy means, and GetString.

    过一会我们就知道多出来的那一部分意味着什么了。

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

  • GetInt You've been calling get string; you've been calling get in, maybe get float and a couple of others.

    你可以调用GetString,可以调用,可能是GetFloat,或者其他的函数。

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

  • Well, get string again is returning the address of the string the user typed in, D the address of the very first character like the letter D and storing that address in this variable s1.

    好的,GetString返回的是,用户输入的字符串的地址,第一个字符的地址,比如字母,然后把这个地址存储在这个变量s1中。

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

  • So when you have a function called GetString, -- that means it's going to get a string from the user -- -- prompt the user for a string -- whereas printf is literally going to print it, not to paper, but to the screen.

    所以当你有一个叫做GetSting的函数,它的意思是从用户那获得一个字符串-,提示用户输入一个字符串-,然而printf的确是用来打印的,不是在纸上,而是在屏幕上。

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

  • If you called get string multiple times, surely you've been able to get different strings from the user.

    如果你调用GetString好几次,你可以从用户那里获得不同的字符串。

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

  • If you instead use GetString, same thing: blinking cursor, the function is just going to wait for the user to type a word, a sentence or whatever, and then hit Enter.

    如果你用GetSring来代替它,同样的:闪烁光标,那个函数只是等待用户来,输入一个单词,一个句子什么的,然后敲回车。

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

  • Odds are when this function called gets a string from the user by expecting them to manipulate their keyboard - with their fingers, I need to-- initiatively I'm gonna get back a sentence or a word or a phrase or something.

    调用GetString获取的信息也有可能,是通过键盘敲进来的,东西-,它将会返回句子啊,单词啊,或词组啊等等一些信息。

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

  • And the reason that we now on the second line have the equal sign is because this function GetString has what's called a return value.

    我们之所以,在第二行代码GetString前面加上等号,是因为这个函数会带回一个,返回值。

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

  • So long as I say I'm gonna put a string here, it doesn't matter what string it is, GetString is gonna take care of the job of getting it from the user.

    把变量放在这,我们先不要管这个string是什么,GetString会负责,从用户那里获取该值。

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

  • But GetString as its name implies is supposed to get something from the user.

    照这么说来,GetString按字面意思解释,就是--从用户那里获取一些东西。

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

  • And the last is perhaps the most useful at least at first glance.

    还有GetString,最后一个用处最大。

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

  • Could you also use GetString ?

    你也可以用GetString【无法辨认的声音】?

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

  • You've used get int, get string, or the like perhaps already.

    你们用过GetInt,GetString,或者其他的。

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

  • So can you use GetString to print the answer?

    所以你能够用GetString来打印答案吗?

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

  • I certainly don't want to assume they're always going to type a three-letter or a four-letter or a two-letter word I want some dynamism but that's fine because get string can get a string of any length, I can then use the string length function to just ask while the program is running how big is the string that I was handed?

    当然我不能假设他总是,输入3个字符或4个字符,或2个字符的单词,我想要动态地分配,因为GetString可以获得任意长度的字符串,然后我可以使用strlen函数,来得到那个我传递的字符串,有多长?

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

  • > It can't find GetString right?

    >,编译器找不到GetString,对吗?

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

  • I mean what if you're running so many things, what if the user has copied and pasted their thesis and just pasted it at the blinking prompt such that you're now out of memory because your computer is somewhat limited in memory so get string cannot possibly return all those characters or fit all of those characters in memory and return to you the address of the first.

    如果你运行了很多程序,假使用户复制粘贴了他们的论文,只是粘贴在光标提示符那里,这样就出现了内存不足,因为你们的计算机的内存是有限的,所以GetString不可能返回所有的字符,或者保存这些字符到内存中,并且返回第一个字符的地址。

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

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

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

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