So in the end, this is just saying allocate me as many bytes s1 as were needed to store s1 itself.
最终,这个只是表示给我分配,足够多的空间来存储。
and how do we fairly and sort of accurately, you know, allocate that out.
我们要怎么样公平并准确的地分配。
So, how do you allocate a pointee?
那么,你怎样分配一个指针数据?
Like I said, with the most valuable resource being the president's time, a lot of efficiently running White House time is spent on how to allocate that precious resource.
正如我所说,在白宫里,最宝贵的资源是总统的时间,很多高效运作的时间,都用于决定如何使用,这个宝贵的资源。
I can absolutely allocate local variables.
我可以分配本地变量。
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.
它为我们做了这些事情,这样我们就可以,通过第一个字节的地址,它还可以通过包含一个特殊的值,来保证在哪里停止,如果你输入了一个三个字母的单词,就可以获得那个字符串,不管怎样,我们分配四个字节,因为我们在末端需要一个额外的字节,来保存这个特殊的标志值--反斜杠。
So before long, we'll see, especially for problems that we can't allocate an int every time we want to store something, because what if we want to store 140,000 English words.
所以不久后,我们将看到,特别是对于,我们不能为int分配内存,每次我们想要,存储一些东西时,因为当我们想要,存储140,000个英语单词时。
应用推荐