首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

cout中的self都是什么意思,该怎么处理

2012-04-08 
cout中的self都是什么意思cout.self ios show base[解决办法]是cout.setf吧[解决办法]msdn,man手册等查下

cout中的self都是什么意思
cout.self ios show base

[解决办法]
是cout.setf 吧
[解决办法]
msdn,man手册等查下不就知道了


Sets the specified flags.

 
void setf(
fmtflags _Mask
);
fmtflags setf(
fmtflags _Mask,
fmtflags _Unset
);
 


Parameters
_Mask
The flags to turn on.

_Unset
The flags to turn off.

Return Value
The previous format flags

Remarks
The first member function effectively calls flags(_Mask | _Flags) (set selected bits) and then returns the previous format flags. The second member function effectively calls flags(_Mask & fmtfl, flags & ~_Mask) (replace selected bits under a mask) and then returns the previous format flags.

Example
Copy Code 
// ios_base_setf.cpp
// compile with: /EHsc
#include <iostream>

int main( ) 
{
using namespace std;
int i = 10;
cout << i << endl;

cout.unsetf( ios_base::dec );
cout.setf( ios_base::hex );
cout << i << endl;

cout.setf( ios_base::dec );
cout << i << endl;
cout.setf( ios_base::hex, ios_base::dec );
cout << i << endl;
}
 

Output
  
10
a
10
a
 

热点排行