Varianti

cpp/string/basic string/begin: differenze tra le versioni

Da cppreference.com.
P12bot (discussione | contributi)
m r2.7.3) (Bot: Aggiungo en, ja, pl, pt, ru
P12bot (discussione | contributi)
m Use {{lc}}. Update links. Various fixes.
 
(3 versioni intermedie di 3 utenti non mostrate)
Riga 1: Riga 1:
{{title|begin}}
{{
Sintassi:
title | begin
}}


<syntaxhighlight lang="cpp">
un iteratore al primo della stringa. |.
    #include <string>
    iterator begin();
    const_iterator begin() const;
</syntaxhighlight>
La funzione ''begin()'' ritorna un iteratore che punta al primo elemento della stringa.
''begin()'' in genere ha tempo di esecuzione [[cpp/complexity | constante]].
Ad esempio, il seguente codice utilizza ''begin()'' per inizializzare un iteratore che e' poi usato per scorrere una lista di caratteri:


<syntaxhighlight lang="cpp">
===
    // Crea una lista di caratteri
()()}
    list<char> charList;
    for( int i=0; i < 10; i++ ) {
      static const char letters[] = "ABCDEFGHIJ";
      charList.push_front( letters[i] );
    }
    // Stampa la lista
    list<char>::iterator theIterator;
    for ( theIterator = charList.begin();
              theIterator != charList.end();
              ++theIterator ) {
      cout << *theIterator;
    }
</syntaxhighlight>


Argomenti correlati: [[cpp/string/basic_string/end | end]], [[cpp/string/basic_string/rbegin | rbegin]], [[cpp/string/basic_string/rend | rend]]
||


[[en:cpp/string/basic string/begin]]
[[en:cpp/string/basic string/begin]]
[[ja:cpp/string/basic string/begin]]
[[ja:cpp/string/basic string/begin]]
[[pl:cpp/string/basic string/begin]]
[[pl:cpp/string/basic string/begin]]
[[pt:cpp/string/basic string/begin]]
[[pt:cpp/string/basic string/begin]]
[[ru:cpp/string/basic string/begin]]
[[ru:cpp/string/basic string/begin]]

Versione attuale delle 22:08, 2 lug 2013

<metanoindex/>

 
 
Stringhe libreria
Null-stringhe terminate
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Byte stringhe
Multibyte stringhe
Stringhe larghe
Classi
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string
char_traits
 
std::basic_string
Membri funzioni
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::basic_string
basic_string::operator=
basic_string::assign
basic_string::get_allocator
Elemento accesso
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::at
basic_string::operator[]
basic_string::front(C++11)
basic_string::back(C++11)
basic_string::data
basic_string::c_str
Iteratori
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::begin
basic_string::cbegin

(C++11)
basic_string::end
basic_string::cend

(C++11)
basic_string::rbegin
basic_string::crbegin

(C++11)
basic_string::rend
basic_string::crend

(C++11)
Capacità
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::empty
basic_string::size
basic_string::length
basic_string::max_size
basic_string::reserve
basic_string::capacity
basic_string::shrink_to_fit(C++11)
Operazioni
Original:
Operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::clear
basic_string::insert
basic_string::erase
basic_string::push_back
basic_string::pop_back(C++11)
basic_string::append
basic_string::operator+=
basic_string::compare
basic_string::replace
basic_string::substr
basic_string::copy
basic_string::resize
basic_string::swap
Cerca
Original:
Search
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::find
basic_string::rfind
basic_string::find_first_of
basic_string::find_first_not_of
basic_string::find_last_of
basic_string::find_last_not_of
Costanti
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string::npos
Non membri funzioni
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator+
operator==
operator!=
operator<
operator>
operator<=
operator>=
swap(std::basic_string)
operator<<
operator>>
getline
stoi
stol
stoll
(C++11)
(C++11)
(C++11)
stoul
stoull
(C++11)
(C++11)
stof
stod
stold
(C++11)
(C++11)
(C++11)
to_string(C++11)
to_wstring(C++11)
Helper classi
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
hash<std::string>
hash<std::wstring>
hash<std::u32string>
hash<std::u16string>
(C++11)
 
<tbody> </tbody>
iterator begin();
const_iterator begin() const;
const_iterator cbegin() const;
(dal C++11)
Restituisce un iteratore al primo carattere della stringa.
Original:
Returns an iterator to the first character of the string.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parametri

(Nessuno)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valore di ritorno

iteratore al primo carattere
Original:
iterator to the first character
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Complessità

Constant
Original:
Constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Vedi anche


(C++11)
restituisce un iteratore dalla coda
(metodo pubblico) [modifica]