标题:文件怎么读写啊
只看楼主
风中飘絮
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-4-2
 问题点数:0 回复次数:0 
文件怎么读写啊

#include<iostream>
#include<fstream>
using namespace std;
int main(){
ifstream in("a.in");
ofstream out("a.out");
for(string str; getline(in,str);)
cout<<str<<endl;
}

------------------Configuration: longxiaoping008 - Win32 Debug--------------------
Compiling...
longxiaoping008.cpp
D:\VC\MSDev98\wolf\longxiaoping008.cpp(7) : error C2065: 'getline' : undeclared identifier
D:\VC\MSDev98\wolf\longxiaoping008.cpp(8) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptable
conversion)
D:\VC\MSDev98\wolf\longxiaoping008.cpp(9) : warning C4508: 'main' : function should return a value; 'void' return type assumed
执行 cl.exe 时出错.

我用的是VC6.0是怎么回事啊!
帮忙大家看看

搜索更多相关主题的帖子: 文件 
2006-04-02 19:59



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




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

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