I'm working on a C++ header file and I keep getting the error "Unknown type name 'string'; did you mean 'std::string'?" #include <string>
is already at the top of my code, so I'm not sure how else to remedy this issue. Any thoughts? I'm using Xcode, if that makes any difference.
#ifndef POINT_HPP
#define POINT_HPP
#include <string>
using namespace std;
class Point {
public:
Point();
Point(int pInitX, int pInitY);
Point(int pInitX, int pInitY, int pInitColor);
double distance(Point pAnotherPoint);
int getColor();
int getX();
int getY();
void move(int pNewX, int pNewY);
void setColor(int pNewColor);
void setX(int pNewX);
void setY(int pNewY);
string toString; // Error: Unknown type name 'string'; did you mean 'std::string'?
private:
void init(int pInitX, int pInitY, int pInitColor);
int mColor;
int mX;
int mY;
};
#endif