名前空間
変種
操作

std::resetiosflags

提供: cppreference.com
< cpp‎ | io‎ | manip
 
 
 
入出力マニピュレータ
浮動小数点フォーマット
整数フォーマット
ブーリアンフォーマット
フィールド幅とフィル制御
その他のフォーマット
ホワイトスペース処理
出力のフラッシュ
ステータスフラグ操作
resetiosflags
時間と通貨の入出力
(C++11)
(C++11)
(C++11)
(C++11)
引用符マニピュレータ
(C++14)
 
ヘッダ <iomanip> で定義
/*unspecified*/ resetiosflags(std::ios_base::fmtflags mask );

out << resetiosflags(mask) または in >> resetiosflags(mask) で使用されたとき、ストリーム out または inmask で指定されたすべての書式フラグをクリアします。

目次

[編集]引数

mask - クリアするフラグのビットマスク

[編集]戻り値

strstd::basic_ostream<CharT, Traits> または std::basic_istream<CharT, Traits> 型のストリームの名前である場合に式 str << resetiosflags(mask) または str >> resetiosflags(mask) が以下のコードが実行されたかのように動作するような、未規定な型のオブジェクトを返します。

str.setf(std::ios_base::fmtflags(0), mask);

[編集]

#include <sstream>#include <iostream>#include <iomanip>int main(){std::istringstream in("10 010 10 010 10 010");int n1, n2; in >>std::oct>> n1 >> n2;std::cout<<"Parsing \"10 010\" with std::oct gives: "<< n1 <<' '<< n2 <<'\n'; in >>std::dec>> n1 >> n2;std::cout<<"Parsing \"10 010\" with std::dec gives: "<< n1 <<' '<< n2 <<'\n'; in >> std::resetiosflags(std::ios_base::basefield)>> n1 >> n2;std::cout<<"Parsing \"10 010\" with autodetect gives: "<< n1 <<' '<< n2 <<'\n';}

出力:

Parsing "10 010" with std::oct gives: 8 8 Parsing "10 010" with std::dec gives: 10 10 Parsing "10 010" with autodetect gives: 10 8

[編集]関連項目

特定の書式フラグをセットします
(std::ios_baseのパブリックメンバ関数)[edit]
指定された ios_base のフラグを設定します
(関数)[edit]
close