std::basic_string::c_str
De cppreference.com
[] |
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. |
<metanoindex/>
<tbody> </tbody> const CharT* c_str() const; |
||
Renvoie un pointeur sur un tableau de caractres termine par NULL avec des donnes quivalentes celles stockes dans la chane. Le pointeur est telle que la plage de
[c_str(); c_str() + size()] est valide et les valeurs qui y correspondent aux valeurs stockes dans la chane de caractres avec un caractre nul en sus de la dernire 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.
Notes
Le pointeur obtenu partir
c_str() ne peut tre trait comme un pointeur vers une chane de caractres termine par NULL si l'objet chane ne contient pas d'autres caractres 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 caractres accessibles via
c_str() est un comportement indfini .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 mme 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.
Paramtres
(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.
Retourne la valeur
Pointeur vers le tableau de caractres termine 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 caractre 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.
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.
Exceptions
Voir aussi
(C++11) |
accde au premier caractre (fonction membre publique) |
(C++11) |
accde au dernier caractre (fonction membre publique) |
| renvoie un pointeur vers le premier caractre d'une chane (fonction membre publique) | |