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