小编Luc*_*Luo的帖子

如何遍历由指针创建的字符串

我想要做的是遍历报价直到报价结束/(*报价中没有任何内容).我的代码有效吗?

char *quote = "To be or not to be, that is the question.";
for (quote = 0; *quote != NULL; quote++){
*quote = tolower(*quote);
}
Run Code Online (Sandbox Code Playgroud)

c string pointers loops

5
推荐指数
1
解决办法
4万
查看次数

标签 统计

c ×1

loops ×1

pointers ×1

string ×1