📄 p11_3.cpp
字号:
/************************************************
* 程序名:p11_3.cpp *
* 功能: 揭开格式标志的秘密 *
* By Antony *
* 8-19-2006 *
*************************************************/
# include <iostream>
using namespace std;
struct fmtflags {
long flag;
char flagname[12];
} flags[18]={{ios::hex,"hex"},
{ios::dec,"dec"},
{ios::oct,"oct"},
{ios::basefield,"basefield"},
{ios::internal,"internal"},
{ios::left,"left"},
{ios::right,"right"},
{ios::adjustfield,"adjustfield"},
{ios::fixed,"fixed"},
{ios::scientific,"scientific"},
{ios::basefield,"basefield"},
{ios::showbase,"showbase"},
{ios::showpoint,"showpoint"},
{ios::showpos,"showpos"},
{ios::skipws,"skipws"},
{ios::uppercase,"uppercase"},
{ios::boolalpha,"boolalpha"},
{ios::unitbuf,"unitbuf"}
};
void main() {
long IFlags;
IFlags=cout.setf(0,cout.flags());
cout.setf(ios::hex,ios::basefield);
cout<<"Default flag is:"<<IFlags<<endl;
for(int i=0;i<18;i++)
cout<<flags[i].flag<<'\t'<<flags[i].flagname<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -