Bibliothèque de chaînes C ++ - rbegin

La description

Il renvoie l'itérateur inverse pour inverser le début.

Déclaration

Voici la déclaration pour std :: string :: rbegin.

reverse_iterator rbegin();
const_reverse_iterator rbegin() const;

C ++ 11

reverse_iterator rbegin() noexcept;
const_reverse_iterator rbegin() const noexcept;

Paramètres

aucun

Valeur de retour

Il renvoie un itérateur inverse au début inverse de la chaîne.

Des exceptions

Ne jetez jamais d'exceptions.

Exemple

Dans l'exemple ci-dessous pour std :: string :: rbegin.

#include <iostream>
#include <string>

int main () {
   std::string str ("Tutorials Point...");
   for (std::string::reverse_iterator rit=str.rbegin(); rit!=str.rend(); ++rit)
      std::cout << *rit;
   return 0;
}

L'exemple de sortie devrait être comme ceci -

...tnioP slairotuT