| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 586 人关注过本帖
标题:怎么后面多输出个东西?
只看楼主 加入收藏
幽灵嫖客
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2007-1-15
收藏
 问题点数:0 回复次数:3 
怎么后面多输出个东西?

下面是源代码:
#include <iostream>
using namespace std;
#include <fstream>

void main()
{
char ch;
ofstream fout;
fout.open("a.txt");
ifstream fin;
fin.open("b.txt");
while(!(fin.eof()))
{
fin>>ch;
fout<<ch;
}

}
b.txt里面的内容是 what you want
输出怎么是wahtyouwantt

搜索更多相关主题的帖子: 源代码 fin txt fout 输出 
2007-07-13 21:32
HJin
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:401
专家分:0
注 册:2007-6-9
收藏
得分:0 
回复:(幽灵嫖客)怎么后面多输出个东西?
fin>>noskipws>>ch;

read more about i/o manipulators.


I am working on a system which has no Chinese input. Please don\'t blame me for typing English.
2007-07-14 02:05
LoveGood
Rank: 1
等 级:新手上路
帖 子:37
专家分:0
注 册:2007-6-2
收藏
得分:0 

#include <iostream>
#include <fstream>
using namespace std;

void main()
{
char ch;
ofstream fout;
fout.open("a.txt");
ifstream fin;
fin.open("b.txt");
fin>>ch;
while(!(fin.eof()))
{
fout<<ch;
fin>>ch;
}
}


路越是难走,就越是有味道~
2007-07-14 02:39
LoveGood
Rank: 1
等 级:新手上路
帖 子:37
专家分:0
注 册:2007-6-2
收藏
得分:0 
编程不要随便对齐~

路越是难走,就越是有味道~
2007-07-14 02:41
快速回复:怎么后面多输出个东西?
数据加载中...
 
   



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

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