Muhammad Khan
Muhammad Khan

Reputation: 425

Eclipse C++ - cannot resolve string type

I'm trying to build a header file, prog1.h, which currently looks as follows:

#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_ */

However, the string identifier is underlined and Eclipse says that "string cannot be resolved to a type". I included everything and am using the standard namespace, so what's the problem?

Thank You!

Upvotes: 1

Views: 1197

Answers (1)

Sara
Sara

Reputation: 823

Try doing std::string and removing the using.

Upvotes: 1

Related Questions