首先,我先做一个检查,我们以前使用过字符串长度函数。
First, I'm going to do a sanity check strlen so we've used string length, strlen, before.
可以指定一个可选的字符串长度单元来指明在哪些单元中表示函数的起始位置和结果。
An optional string length unit can be specified to indicate in what units the start and result of the function are expressed.
如果使用CODEUNITS来获取字符的长度,则用作字符串函数输入的CODEUNITS的不同会导致输出的不同。
If you take the length of a character in CODEUNITS, the output differs according to the CODEUNITS used as inputs to the string function.
First, I'm going to do a sanity check strlen so we've used string length, strlen, before.
首先,我先做一个检查,我们以前使用过字符串长度函数。
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函数,来得到那个我传递的字符串,有多长?
应用推荐