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 类

iostream 编程

iostreams 约定