error C2061: 语法错误 : 标识符“ofstream”
各位!
我碰到一个怪怪的编译错误:我头文件里有个函数std::ofstream& OpenFile(ofstream &outfile) const;
并且我在头文件里加了:#include <fstream>,但在编译时有如下错误:
error C2061: 语法错误 : 标识符“ofstream”
要是我把函数改为ofstream& OpenFile(ofstream &outfile) const;同时在头文件里加using std::ofstream
就没有错误啦。这是为什么?