enum { skipws = 0x0001,
left = 0x0002,
right = 0x0004,
internal = 0x0008,
dec = 0x0010,
oct = 0x0020,
hex = 0x0040,
showbase = 0x0080,
showpoint = 0x0100,
uppercase = 0x0200,
showpos = 0x0400,
scientific = 0x0800,
fixed = 0x1000,
unitbuf = 0x2000,
stdio = 0x4000
}; static const long basefield; // dec | oct | hex
static const long adjustfield; // left | right | internal
static const long floatfield; // scientific | fixedios类中的一段代码,有函数out.setf(ios::hex,ios::basefield) 这个函数的第二个参数好理解,就是IOS类的那个basefield变量成员,但是第一个参数是咋回事,咋 ios::hex 就用上了,我认为应该这样定义下 static long hex , 才可以这ios::hex 用吧,不知道我那理解错了???
解决方案 »
- ocx打包cab后网页自动下载安装问题
- 定义CFileFind时,遇到的奇怪问题,竟然少了一个成员-_-||
- dshow的sdk例子中CaptureTex9, 怎么修改摄像头分辨率? 谢谢!
- 诚聘VC++和网页设计兼职
- 用win32如何实现播放mp3?
- c-runtime 和 win32 API是什么关系呀?
- 高分求助 Visual Studio 6 界面增强工具(1.0) 的下载(50分)
- 求助,鼠标点击右键的弹出式菜单?请问如何实现,高手请进啊。
- 要不然我的QQ永远比藤讯公司的差,因为数据管理没编出来!!!
- HELP!我写了一个MP3播放器,但不知如何实现只运行此程序的一个实例,并且由此实例接收以后关联文件的打开?就像WINAMP一样双击多个关联文件而只由一个实例运行.
- 关于vfw和directshow应用于单点对多点视频会议系统的选择问题
- 谁提供点关于BHO的资料啊或者教程啊
VC6函数实现代码:
inline long ios::setf(long _l, long _m)
{
...
x_flags = (_l&_m) | (x_flags&(~_m))
...
}第一个参数的设置直接影响类的x_flags变量.
left = 0x0002,
right = 0x0004,
internal = 0x0008,
dec = 0x0010,
oct = 0x0020,
hex = 0x0040,
showbase = 0x0080,
showpoint = 0x0100,
uppercase = 0x0200,
showpos = 0x0400,
scientific = 0x0800,
fixed = 0x1000,
unitbuf = 0x2000,
stdio = 0x4000
};
如果是等效于
const long kipws = 0x0001,
const long left = 0x0002,
const long right = 0x0004,
const long internal = 0x0008,
const long dec = 0x0010,
const long oct = 0x0020,
const long hex = 0x0040,
const long showbase = 0x0080,
const long showpoint = 0x0100,
const long uppercase = 0x0200,
const long showpos = 0x0400,
const long scientific = 0x0800,
const long fixed = 0x1000,
const long unitbuf = 0x2000,
const long stdio = 0x4000,就好理解out.setf(ios::hex,ios::basefield)里面的ios::hex这个参数,楼上的还是没说清楚ios::hex这个参数这个参数是怎么回事,
上面的等式效果成立不?
const long hex = 0x0040;
那就很正常,我这里说的不是什么别的,只是说为啥是这样定义的
enum { skipws = 0x0001,
left = 0x0002,
right = 0x0004,
internal = 0x0008,
dec = 0x0010,
oct = 0x0020,
hex = 0x0040,
showbase = 0x0080,
showpoint = 0x0100,
uppercase = 0x0200,
showpos = 0x0400,
scientific = 0x0800,
fixed = 0x1000,
unitbuf = 0x2000,
stdio = 0x4000
}; 这里怎么这样定义,为什么这样定义,没见过这样的,根本不理解这是个什么样的语法规则,是不是我在七楼说的等效于娜一段定义代码????
STL里面有很多这样的定义的。