繁体   English   中英

Eclipse C ++-无法解析字符串类型

[英]Eclipse C++ - cannot resolve string type

我正在尝试构建头文件prog1.h,该文件当前如下所示:

#ifndef PROG1_H_
#define PROG1_H_

#include <fstream>
#include <string>
#include <cstdlib>
#include <iostream>

using namespace std;

const int NUMGRADES = 5;

struct StudentInfo{
    string id;
    double avGrade;
    int grades[NUMGRADES];
};

int ReadGrades(istream & input, StudentInfo Info[]);

void HighestAverage(StudentInfo Info[], int numStudents, string & id, double & maxAv);

#endif /* PROG1_H_ */

但是,字符串标识符带有下划线,并且Eclipse表示“字符串无法解析为类型”。 我包含了所有内容,并且正在使用标准名称空间,那么这是什么问题呢?

谢谢!

尝试执行std :: string并删除using。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM