以ios::binary方式打开,换行符被解释成\r\n;反之,换行符被解释成\n。
Windows操作系统是用两个字符(\r\n)来表示换行符的;而Unix操作系统却是用单个字符(\n)来表示换行符的。
#define _IOS_Nocreate 0x40
#define _IOS_Noreplace 0x80
#define _IOSbinary 0x20
static constexpr _Openmode in = (_Openmode)0x01;
static constexpr _Openmode out = (_Openmode)0x02;
static constexpr _Openmode ate = (_Openmode)0x04;
static constexpr _Openmode app = (_Openmode)0x08;
static constexpr _Openmode trunc = (_Openmode)0x10;
static constexpr _Openmode _Nocreate = (_Openmode)_IOS_Nocreate;
static constexpr _Openmode _Noreplace = (_Openmode)_IOS_Noreplace;
static constexpr _Openmode binary = (_Openmode)_IOSbinary;