Translations of this page?:

push_back

Sintaxe:

    #include <string>
    void push_back( Char c );

A função push_back() acrescenta c ao fim da string. Por exemplo, o código seguinte adiciona 10 caracteres a uma string:

     string the_string;
     for( int i = 0; i < 10; i++ )
       the_string.push_back( i+'a' );

Quando mostrada, a string resultante teria um aspecto semelhante a este:

    abcdefghij

push_back() corre em tempo constante.

Tópicos Relacionados: assign, insert

 
• • • SitemapRecent changesRSScc