• Now, if I've asked the user for a string and then a moment later I ask the user for another string, well, they're going to end up in different locations in memory just by nature of get string.

    现在,如果我要用户输入一个字符串,一会儿之后我要用户输入另一个字符串,他们最终是在,不同的内存地址中。

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

  • When you've been typing in words to the keyboard like your name or any word that you're trying to provide to the user, a string really looks like this.

    当你们通过键盘键入单词,比如你的名字,或者你想提供给用户的任何单词,一个字符串实际上看起来就是这样。

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

  • Otherwise, what was the point of getting a string from the user if I'm not handed the result to actually do something interesting with.

    否则的话,它不把值带给我们,我们就做不了想做的事情,那我们还要它有什么用呢?

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

  • So now, in a program and you're asking the user for a string.

    我们再回到程序里,向用户要一个字符串。

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

  • s1 We're assigning to s1 the string that the user typed in.

    我们把用户输入的字符串赋值给。

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

  • 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的确是用来打印的,不是在纸上,而是在屏幕上。

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

  • 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型,你可能会被吼叫,然后用户不得不重新尝试。

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

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

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

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

  • Well, we certainly didn't know on day one how many times each of you was going to want to call get string, how many words a user might type when you call get string.

    好的,当然我们不知道第一天你们,想要调用GetSting多少次,当你调用GetSting时,用户会输入多少单词。

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

  • This is copy2.c. At the very beginning I, again, demand say something and then I declare s1 to be a string, aka char *, and I store in s1 the string the user types in.

    这是copy2。c,在开头打印一句话,然后声明s1是一个字符串,也叫做char,*,然后把用户输入的字符串存储在s1中。

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

  • 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获取的信息也有可能,是通过键盘敲进来的,东西-,它将会返回句子啊,单词啊,或词组啊等等一些信息。

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

  • 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会负责,从用户那里获取该值。

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

  • I'm going to use the CS50 Library instead for user input I'm saying say something then I'd get a string from the user and I call time s1 and then I say, say something, s2 and then I get another string from the user and call it s2 and apparently this program's purpose in life is to tell me yes or no the user said the same thing both times.

    然而我使用的是CS50库来获得用户输入,我说点什么,然后从用户那里获得一个字符串,并把它叫做s1,然后我说点什么,然后从用户那里获得一个字符串,并把它叫做2,这个程序的最终目的是,告诉我两次用户输入的是不是同样的东西。

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

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

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

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