讨论一下这段程序!!!

zliang520 2003-05-16 03:31:37
#include "iostream"
#include "fstream"
using namespace std;
#define BUFSIZE 4096
void main(void)
{
ifstream s_file;
ofstream d_file;
s_file.open("source.txt",ios::in);
d_file.open("dest.txt",ios::out);
char buffer[BUFSIZE];
int len;
while(!s_file.eof())
{
len=s_file.read(buffer,BUFSIZE);
d_file.write(buffer,len);
d_file.flush();
};


}
在vc6下编译总是不通过,出现的error是binary '=' : no operator defined which takes a right-hand operand of type 'class std::basic_istream<char,struct std::char_traits<char> >' (or there is no acceptable conversion)
就是len=这一句不对,难道要转换为int?
请教!
...全文
20 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

24,855

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧