C++ Primer 破书,905页,20章iostream库的问题
#include <iostream>
#include <fstream>
using namespace std;
main()
{
//以输入和附加模式打开
fstream inOut("copy.out",ios_base::in | ios_base::app);
int cnt =0;//字节计数
char ch;
inOut.seekg(0);
while(inOut.get(ch))
{
cout.put(ch);
++cnt;
if(ch == '\n')
{
ios_base::pos_type mark=inOut.tellg();
inOut.seekg(mark);
}
}
//输出字节数
cout << endl <<cnt << endl;
return 0;
}
这个程序又编译不成???VC 6.0