关于C++ifstream infile

[复制链接]
查看11 | 回复3 | 2011-11-9 14:15:21 | 显示全部楼层 |阅读模式
ios::noreplace是文件存在时,不打开文件。你已经有了“分数统计.txt"这个文件的话,打开失败。...
回复

使用道具 举报

千问 | 2011-11-9 14:15:21 | 显示全部楼层
ifstream是输出文件,ofstream是读入文件,你代码里面的是输出的,一般是可以的,不过ios::noreplace不知道你是什么来的,fstream里面没这个定义。代码写成这样是可以的#include#includeusing namespace std;void main(void)...
回复

使用道具 举报

千问 | 2011-11-9 14:15:21 | 显示全部楼层
#include#include#includeusing namespace std;int main(void){ofstream outfile("分数统计.txt",ios::out | ios::app);if(!outfile){cout#include using namespace std;...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行