• First, I'm going to do a sanity check strlen so we've used string length, strlen, before.

    首先,我先做一个检查,我们以前使用过字符串长度函数。

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

  • N So, I'm initializing a variable called N to the string length of s1.

    我初始化一个变量,等于s1的字符串长度。

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

  • It says if this is a string of length 0 or 1, I'm done. I'm going to return the answer true.

    我就会返回答案为真,否则的话我得判断它。

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

  • 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函数,来得到那个我传递的字符串,有多长?

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

  • - And because I'm writing out a string that's the same length -- -- my strings aren't getting shorter -- it's creating this illusion of some animation.

    因为我写了一个长度相同的字符串-,我的字符串不会变的更短-,它生成一个动画幻觉。

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

  • Even though there's four bytes the length of the string is consistent with what a human being would interpret as the length 3 of the string which is 3.

    即使那里有4个字节,字符串的长度,与我们所认为的长度是一致的,字符串的长度是。

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

  • I just doubled the indentation each time so you can see it. So each successive call, notice what's happening. The argument is getting reduced. And we're going another level in. When we get down to this point, we're calling it with just a string of length one.

    因此每次成功调用注意它的过程,我们的命题不断简化,而且我们不断深入嵌套,当我们走到这一步的时候,我们就是在调用它处理,仅有一个元素的字符串了。

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

  • So strlen is the length of a string.

    所以strlen就是字符串的长度。

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

  • Well, this question mark becomes an O, this question mark becomes an O, and then the loop terminates 0 1 2 because it's iterating from zero to N so that's zero, 1, 2 and the length of the string is 3 so the loop terminates, but I remember that I needed to have this special sentinel value so I'm just going to put it there manually.

    嗯,这个问号变成了,这个问号变成了0,然后循环结束了,以为迭代从0到N,那就是,字符串的长度是3,然后循环就结束了,但是我记得我需要这个特殊的标记值,所以需要手动的加上它。

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

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

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

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