std::basic_string::c_str
提供: cppreference.com
< cpp | string | basic string
![]() | このページは、Google 翻訳を使って英語版から機械翻訳されました。 翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
const CharT* c_str()const; | ||
文字列内に格納されているものと同等のデータを持つNULLで終わる文字配列へのポインタを返します。ポインタが範囲
[c_str(); c_str() + size()]
が有効であり、その中の値は、最後の位置の後に追加のNULL文字を含む文字列に格納された値に対応するようです.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.
目次 |
[編集]ノート
c_str()
から得られたポインタは、文字列オブジェクトが他のヌル文字が含まれていない場合、NULLで終わる文字列へのポインタとして扱われるかもしれません.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.
c_str()
で未定義の動作を介してアクセスされた文字配列への書き込み.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.
以来、C + +11、
c_str()
data()
と同じ機能を実行します.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.
[編集]パラメータ
(なし)
[編集]値を返します
そのようなdata()[i]== operator[](i)内のすべての
i
ため[0, size()]
そのNULLで終わる文字配列へのポインタ。 (C++11以前)Original:
Pointer to the null-terminated character array such that data()[i]== operator[](i) for every
i
in [0, size()]
. (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.
そのようなdata()+ i ==&operator[](i)内のすべての
i
ため[0, size()]
その基礎となる文字ストレージへのポインタ。 (C++11およびそれ以降)Original:
Pointer to the underlying character storage such that data()+ i ==&operator[](i) for every
i
in [0, size()]
. (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.
[編集]複雑性
定数.
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.
[編集]例外
[編集]参照
(C++11) | 最初の文字にアクセスします Original: accesses 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. (パブリックメンバ関数) |
(C++11) | 最後の文字にアクセスします Original: accesses the last character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |
文字列の最初の文字へのポインタを返します Original: returns a pointer to the first character of a string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |