std中使用ofstream的问题,很奇怪
cmoth 2002-04-10 09:10:31 用旧式流库如下:
#include <fstream.h>
ofstream ofile("c:\\1.txt",ios::app|ios::out);
ifstream ifile("c:\\2.txt");
没问题
但用std的流库:
#include <fstream>
using namespace std;
ofstream ofile("c:\\1.txt",ios::app|ios::out); //<------
ifstream ifile("c:\\2.txt");
在标注行会出错,提示“bad handle",这是怎么回事?难道新的不是这样用的?