【发布时间】:2012-03-15 08:14:34
【问题描述】:
如何在 C++ 中对字符串中的每个字符执行 for 循环?
【问题讨论】:
-
什么样的字符串? C 字符串,或
std::string? -
它是从文本文件中读取的,所以我假设 std::
-
什么样的角色?
char,Unicode 码位,扩展字素簇? -
How can I iterate through a string and also know the index (current position)? 的可能重复项。不要担心答案中的
index部分。
标签: c++ loops for-loop character