So now that we begin to have this ability to express strings in memory, to understand what they are, we can start to apply actually real-world algorithms to them.
现在我们开始用这个技能来在内存中表达字符串,来理解它们是什么,我们可以开始,我们可以对其使用实际的,现实生活中的算法。
- 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.
因为我写了一个长度相同的字符串-,我的字符串不会变的更短-,它生成一个动画幻觉。
OK, I can certainly print out strings, but I can actually add strings together, and just as you saw, I can multiply strings, you can kind of guess what this is going to do.
当然我可以显示字符串,但是其实我还可以令字符串相加,如你所见到的,我可以令字符串相乘,你们可以想想答案是什么。
And this is a place where it's comparing strings and numbers in a strange way.
这里其实是对字符串和数字,以一种相当奇怪的方式进行比较的。
Well at some level it is an ordered sequence of characters. Right? Now it is not represented this same way. You don't see strings inside these open parens and closed parens.
现在字符串不是用这种方式表达的,你没有看到字符串里有开括号闭括号,字符串中间也没有逗号,但是它有同样的属性。
And so if we wanted to do this here, it's again, the same thing we're just now pulling back this layer and calling them char *s not actually strings.
如果我们想要在这里这样做,再次,我们撤销这一层,把它们叫做char,*s,实际上不是字符串。
应用推荐