在使用strtok时发现:
char strTest[] = "what is the difference"; //正常
char *strTest = "what is the difference"; //运行时错误
另外,如果字符串末尾没有空格,如何取出最后一个单词?比如这里的differcence
谢谢!
...全文
14310打赏收藏
【求助】请问char* str和 char str[]有什么区别?谢谢!
在使用strtok时发现: char strTest[] = "what is the difference"; //正常 char *strTest = "what is the difference"; //运行时错误 另外,如果字符串末尾没有空格,如何取出最后一个单词?比如这里的differcence 谢谢!