std::ios::oct 与 std::oct 的不同
std::oct
inline ios_base&
oct(ios_base& __base)
{
__base.setf(ios_base::oct, ios_base::basefield);
return __base;
}
std::ios::oct
static const fmtflags oct = _S_oct;
全都在ios_base.h里面...
std::ios返回一个ios_base&对象,std::ios::oct就只是一个数...
所以设置std::cout输出格式的时候应当用std::oct而不是std::ios::oct
其余hex/dec 大概同理

浙公网安备 33010602011771号