cend
描述 (Description)
它返回一个指向字符串的过去字符的const_iterator。
声明 (Declaration)
以下是std :: string :: cend的声明。
const_iterator cend() const noexcept;
C++11
const_iterator cend() const noexcept;
参数 (Parameters)
没有
返回值 (Return Value)
它将const_iterator返回到字符串的过去结尾。
异常 (Exceptions)
永远不要抛出任何例外
例子 (Example)
在下面的示例中为std :: string :: cend。
#include <iostream>
#include <string>
int main () {
std::string str ("iowiki india PVT Ltd");
for (auto it=str.cbegin(); it!=str.cend(); ++it)
std::cout << *it;
std::cout << '\n';
return 0;
}
样本输出应该是这样的 -
iowiki india PVT Ltd