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

📄 14-2.cpp

📁 为初学者提供的最佳的C++程序设计源程序库
💻 CPP
字号:
#include<iostream.h>
void showflags();
main()
{
  showflags();
  cout.setf(ios::oct|ios::showbase|ios::fixed);
  showflags();
  return 0;
}
void showflags()
{
  long f,i;
  int j;
  char flgs[15][12]={
    "skipws",
	"left",
	"right",
	"internal",
	"dec",
	"oct",
	"hex",
	"showbase",
	"showpoint",
	"uppercase",
	"showpos",
	"scientific",
	"fixed",
	"unitbuf",
	"stdio",
  };
  f=cout.flags();
  for(i=1,j=0;i<0x4000;i=i<<1,j++)
    if(i&f)
	  cout<<flgs[j]<<"is on\n";
	else cout<<flgs[j]<<"is off\n";
  cout<<"\n";
}

⌨️ 快捷键说明

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