std:: ends
| I/O manipulators | ||||
| Print functions (C++23) | ||||
| C-style I/O | ||||
| Buffers | ||||
|
(C++23)
|
||||
|
(
C++98/26*
)
|
||||
|
(C++20)
|
||||
| Streams | ||||
| Abstractions | ||||
| File I/O | ||||
| String I/O | ||||
| Array I/O | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(
C++98/26*
)
|
||||
|
(
C++98/26*
)
|
||||
|
(
C++98/26*
)
|
||||
| Synchronized Output | ||||
|
(C++20)
|
||||
| Types | ||||
| Error category interface | ||||
|
(C++11)
|
||||
|
(C++11)
|
| Floating-point formatting | |||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
| Integer formatting | |||||||||||||||||||||||||||||||
| Boolean formatting | |||||||||||||||||||||||||||||||
| Field width and fill control | |||||||||||||||||||||||||||||||
| Other formatting | |||||||||||||||||||||||||||||||
| Whitespace processing | |||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
| Output flushing | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Status flags manipulation | |||||||||||||||||||||||||||||||
| Time and money I/O | |||||||||||||||||||||||||||||||
| Quoted manipulator | |||||||||||||||||||||||||||||||
|
(C++14)
|
|||||||||||||||||||||||||||||||
|
ヘッダーで定義
<ostream>
|
||
|
template
<
class
CharT,
class
Traits
>
std:: basic_ostream < CharT, Traits > & ends ( std:: basic_ostream < CharT, Traits > & os ) ; |
||
出力シーケンスにヌル文字を挿入します。 os によって、あたかも os. put ( CharT ( ) ) を呼び出したかのように。
これは出力専用のI/Oマニピュレータであり、
out
<<
std
::
ends
のような式で呼び出すことができます。ここで
out
は
std::basic_ostream
型の任意の出力ストリームです。
目次 |
注記
このマニピュレータは通常、 std:: ostrstream と共に使用され、関連付けられた出力バッファをC文字列として処理するためにヌル終端する必要がある場合に用いられます。
std::endl とは異なり、このマニピュレータはストリームをフラッシュしません。
パラメータ
| os | - | 出力ストリームへの参照 |
戻り値
os (ヌル文字挿入後のストリームへの参照)。
例
#include <cstdio> #include <strstream> int main() { std::ostrstream oss; oss << "Sample text: " << 42 << std::ends; std::printf("%s\n", oss.str()); oss.freeze(false); // enable memory deallocation }
出力:
Sample text: 42
関連項目
|
(C++98で非推奨)
(C++26で削除)
|
文字配列出力操作を実装する
(クラス) |