std::basic_string::c_str
Da cppreference.com.
< cpp | string | basic string
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
const CharT* c_str()const; | ||
Restituisce un puntatore a una terminazione null array di caratteri con i dati equivalenti a quelli memorizzati nella stringa. Il puntatore è tale che l'intervallo
[c_str(); c_str() + size()]
è valido e valori in esso corrispondono ai valori memorizzati nella stringa con un carattere nullo aggiuntivo dopo l'ultima posizione.Original:
Returns a pointer to a null-terminated character array with data equivalent to those stored in the string. The pointer is such that the range
[c_str(); c_str() + size()]
is valid and the values in it correspond to the values stored in the string with an additional null character after the last position.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica]Note
Il puntatore ottenuto da
c_str()
possono essere trattati come un puntatore a una stringa con terminazione null di caratteri se l'oggetto stringa non contiene altri caratteri nulli.Original:
The pointer obtained from
c_str()
may only be treated as a pointer to a null-terminated character string if the string object does not contain other null characters.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
La scrittura della matrice di caratteri si accede tramite
c_str()
è un comportamento indefinito.Original:
Writing to the character array accessed through
c_str()
is undefined behavior.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Dal momento che C + +11,
c_str()
data()
e svolgono la stessa funzione.Original:
Since C++11,
c_str()
and data()
perform the same function.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifica]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.
You can help to correct and verify the translation. Click here for instructions.
[modifica]Valore di ritorno
Puntatore alla terminazione Null array di caratteri in modo tale che per ogni data()[i]== operator[](i)
i
in [0, size()]
. (fino al c++11)Original:
Pointer to the null-terminated character array such that data()[i]== operator[](i) for every
i
in [0, size()]
. (fino al c++11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Puntatore alla memoria carattere di fondo in modo tale che per ogni data()+ i ==&operator[](i)
i
in [0, size()]
. (dal C++11)Original:
Pointer to the underlying character storage such that data()+ i ==&operator[](i) for every
i
in [0, size()]
. (dal C++11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifica]Complessità
Costante.
Original:
Constant.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifica]Eccezioni
[modifica]Vedi anche
(C++11) | accede al primo carattere (metodo pubblico) |
(C++11) | accede all'ultimo carattere (metodo pubblico) |
restituisce un puntatore al primo carattere di una stringa (metodo pubblico) |