std::basic_string::c_str
De cppreference.com
< cpp | string | basic string
![]() | This page has been machine-translated from the English version of the wiki using Google Translate. The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
const CharT* c_str()const; | ||
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.
You can help to correct and verify the translation. Click here for instructions.
Sommaire |
[modifier]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.
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.
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.
You can help to correct and verify the translation. Click here for instructions.
[modifier]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.
You can help to correct and verify the translation. Click here for instructions.
[modifier]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.
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.
You can help to correct and verify the translation. Click here for instructions.
[modifier]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.
You can help to correct and verify the translation. Click here for instructions.
[modifier]Exceptions
[modifier]Voir aussi
(C++11) | accède au premier caractère (fonction membre publique) |
(C++11) | accède au dernier caractère (fonction membre publique) |
renvoie un pointeur vers le premier caractère d'une chaîne (fonction membre publique) |