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

La description

Il renvoie const_reverse_iterator à la fin inverse.

Déclaration

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

const_reverse_iterator crend() const noexcept;

C ++ 11

const_reverse_iterator crend() const noexcept;

Paramètres

aucun

Valeur de retour

Il renvoie un const_reverse_iterator à l'extrémité inverse de la chaîne.

Des exceptions

Ne jetez jamais d'exceptions.

Exemple

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

#include <iostream>
#include <string>

int main () {
   std::string str ("Tutorials Point");
   for (auto rit=str.crbegin(); rit!=str.crend(); ++rit)
      std::cout << *rit;
   std::cout << '\n';

   return 0;
}

L'exemple de sortie devrait être comme ceci -

tnioP slairotuT