ios_base::flags

设置或返回当前设置了标志。

fmtflags flags( ) const; 
fmtflags flags(
   fmtflags fmtfl
);

参数

  • fmtfl
    fmtflags 设置。

返回值

上个月或当前 fmtflags 设置。

备注

有关标志的列表参见 ios_base::fmtflags

第一个成员函数返回存储的格式标志。第二个成员函数在格式标志存储 fmtfl 并返回其以前存储的值。

示例

// ios_base_flags.cpp
// compile with: /EHsc
#include <iostream>
#include <fstream>

int main ( ) 
{
   using namespace std;
   cout << cout.flags( ) << endl;
   cout.flags( ios::dec | ios::boolalpha );
   cout << cout.flags( );
}
  

要求

标头: <ios>

命名空间: std

请参见

参考

ios_base Class

iostream编程

(mfc)约定