std::basic_string::c_str — cppreference.com
De cppreference.com
<metanoindex/>
<tbody> </tbody>
|
|
||
Renvoie un pointeur sur un tableau de caractères terminée par NULL avec des données équivalentes à celles stockées dans la chaîne. Le pointeur est telle que la plage de [c_str(); c_str() + size()] est valide et les valeurs qui y correspondent aux valeurs stockées dans la chaîne de caractères avec un caractère nul en sus de la dernière position .
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.
Notes
Le pointeur obtenu à partir c_str() ne peut être traité comme un pointeur vers une chaîne de caractères terminée par NULL si l'objet chaîne ne contient pas d'autres caractères nuls .
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.
L'écriture dans le tableau de caractères accessibles via c_str() est un comportement indéfini .
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.
Puisque C + +11, c_str() et data() remplissent la même fonction .
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.
Paramètres
(Aucun)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Retourne la valeur
Pointeur vers le tableau de caractères terminée par NULL tels que data()[i] == operator[](i) pour chaque i dans [0, size()]. (avant C++11)
Original:
Pointer to the null-terminated character array such that data()[i] == operator[](i) for every i in [0, size()]. (avant C++11)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Pointeur vers le stockage caractère sous-jacent tel que data() + i == &operator[](i) pour chaque i dans [0, size()]. (depuis C++11)
Original:
Pointer to the underlying character storage such that data() + i == &operator[](i) for every i in [0, size()]. (depuis C++11)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Complexité
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.
Exceptions
Voir aussi
(C++11) |
accède au premier caractère (fonction membre publique) [edit] |
(C++11) |
accède au dernier caractère (fonction membre publique) [edit] |
| renvoie un pointeur vers le premier caractère d'une chaîne (fonction membre publique) [edit] | |