【发布时间】:2015-12-15 00:33:35
【问题描述】:
我得到两种语法?即使项目成功构建也会出错。在我评论过的以下位置,我的代码的某些部分在 Visual Studio 中突出显示为红色:
#include <vector>
#include <string>
#include <iostream>
#include <ifstream> //include is highlighted// Error: cannot open source file "ifstream"
using namespace std;
class DictionarySorter{
public:
DictionarySorter(){
}
void readDic(string name){
ifstream dicFile (name); //dicFile is highlighted here// Error: incomplete type is not allowed
}
private:
vector<string> v;
};
【问题讨论】: