⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 set_allf.cpp

📁 不错书对C++/C程序员很有用的大家不要错过.
💻 CPP
字号:
#include <iostream.h>

void showflags(void);

void main(void)
 {
   showflags();
   long f = ios::showpos | ios::showbase | ios::oct | ios::right;
   cout.flags(f);
   showflags();
 }

void showflags(void)
 {
   long flag_set, i;
   int j;
   char flags[15][12] = {
      "skipws", "left", "right", "internal", "dec",
      "oct", "hex", "showbase", "showpoint", "uppercase",
      "showpos", "scientific", "fixed", "unitbuf",
   };

   flag_set = cout.flags();
   for (i=1, j=0; i<0x2000; i = i<<1, j++)
      if (i & flag_set)
         cout << flags[j] << " is on." << endl;
      else
         cout << flags[j] << " is off." << endl;
   cout << endl;
 }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -