C ++中以二进制和文本模式编写的文件之间的区别
,执行各种字符翻译,即:
“\r+\f”转换为“\n”
不执行此类转换。
ofstreamofs(“file.txt”);
或
ofofofs;
ofs.open(“file.txt”);
ofstreamofs(“file.txt”,ios::binary);
或
ofstream的OFS;
ofs.open(“file.txt”,ios::binary);
Ofstreamofs(“file.txt”,ios::app);
或
ofstream的OFS;
ofs.open(“file.txt”,ios::app);
Ofstream
ofs(“file.txt”,ios::app|ios::binary);
或
ofs.open(“file.txt”,ios::app|ios::binary);
ifstreamin(“file.txt”);
或
ifstream
in;in.open(“file.txt”);
ifstreamin(“file.txt”,ios::binary);
或
ifstreamin;
in.open(“file.txt”,ios::binary);
热门推荐
10 分别发的祝福语简短
11 大外甥高考祝福语简短
12 小学毕业校长简短祝福语
13 搞工程发财祝福语简短
14 冬季祝福语男生文案简短
15 同事生子问候祝福语简短
16 退休文案寄语简短祝福语
17 送给自己的祝福语简短
18 简短祝福语毛笔字