std:: showpos, std:: noshowpos
|
定義先ヘッダ
<ios>
|
||
|
std::
ios_base
&
showpos
(
std::
ios_base
&
str
)
;
|
(1) | |
|
std::
ios_base
&
noshowpos
(
std::
ios_base
&
str
)
;
|
(2) | |
非負整数の出力におけるプラス記号 '+' の表示を有効または無効にします。入力には影響しません。
これはI/Oマニピュレータであり、
out
<<
std
::
showpos
のような式で、
out
が
std::basic_ostream
型の場合に呼び出せる。または、
in
>>
std
::
showpos
のような式で、
in
が
std::basic_istream
型の場合に呼び出せる。
目次 |
パラメータ
| str | - | 参照するI/Oストリーム |
戻り値
str (操作後のストリームへの参照)。
例
#include <iostream> int main() { std::cout << "showpos: " << std::showpos << 42 << ' ' << 3.14 << ' ' << 0 << '\n' << "noshowpos: " << std::noshowpos << 42 << ' ' << 3.14 << ' ' << 0 << '\n'; }
出力:
showpos: +42 +3.14 +0 noshowpos: 42 3.14 0
関連項目
|
指定された ios_base フラグをクリア
(関数) |
|
指定された
ios_base
フラグを設定
(関数) |