讨论一下这段程序!!!
#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?
请教!