标题:文件的输入?
取消只看楼主
corrupt
Rank: 2
等 级:新手上路
威 望:3
帖 子:535
专家分:0
注 册:2004-9-29
 问题点数:0 回复次数:2 
文件的输入?

我写了个文件的输入的程序,但是当我输入(我 爱 你 *) -----注意中间有空格

结果 在文本 dat.txt中 显示没空格呢?? 向各位请教~

#include<iostream.h> #include<fstream.h> #include<stdlib.h> void main() { char c; ofstream fout; fout.open("E:\\dat.txt"); if(!fout) { cout<<"EROOR:can not open:"; exit(1); } while(c!='*') { cin>>c; fout.put(c); } fout.close(); }

搜索更多相关主题的帖子: 文件 输入 
2004-11-20 22:54
corrupt
Rank: 2
等 级:新手上路
威 望:3
帖 子:535
专家分:0
注 册:2004-9-29
得分:0 

朋友能不能说清楚些?

我不懂唉~~


2004-11-21 08:04
corrupt
Rank: 2
等 级:新手上路
威 望:3
帖 子:535
专家分:0
注 册:2004-9-29
得分:0 

ok~~

thank you very much!


2004-11-21 08:35



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-7959-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.077615 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved