Right, so there's that special sentinel value that's back slash zero, which we'll start to see more explicitly now.
对的,这里有一个特殊的值“反斜杠0“,我们等下会更了解它。
I could have done this in another way but I am going to just be extra deliberate so I make sure that this copy ends with back slash zero and voila, now, I have a copy.
我可以用另外一种方式来处理,我确保这个拷贝由反斜杠0结尾,那样,现在我得到了一个拷贝。
The back slash zero, right?
是反斜杠0,对不?
So it does that for us so that you can get away with just knowing the address of the first byte and it will make sure that you know when to stop by including the special value so, in fact, get the string if you type in a three-letter word, we allocate four bytes no matter what because we need an additional byte 0 for this special sentinel value back slash zero at the very end.
它为我们做了这些事情,这样我们就可以,通过第一个字节的地址,它还可以通过包含一个特殊的值,来保证在哪里停止,如果你输入了一个三个字母的单词,就可以获得那个字符串,不管怎样,我们分配四个字节,因为我们在末端需要一个额外的字节,来保存这个特殊的标志值--反斜杠。
应用推荐