目录

rend

描述 (Description)

它将反向迭代器返回到反向结束。

声明 (Declaration)

以下是std :: string :: rend的声明。

reverse_iterator rend();
const_reverse_iterator rend() const;

C++11

reverse_iterator rend() noexcept;
const_reverse_iterator rend() const noexcept;

参数 (Parameters)

没有

返回值 (Return Value)

它将反向迭代器返回到字符串的反向末尾。

异常 (Exceptions)

永远不要抛出任何例外

例子 (Example)

在下面的示例中为std :: string :: rend。

#include <iostream>
#include <string>
int main () {
   std::string str ("IOWIKI...");
   for (std::string::reverse_iterator rit=str.rbegin(); rit!=str.rend(); ++rit)
      std::cout << *rit;
   return 0;
}

样本输出应该是这样的 -

...tnioP slairotuT 
↑回到顶部↑
WIKI教程 @2018