Ive looked all over and I cant find anything relating to my problem. Im trying to write a class definition for a polygon class that basicly has a vector that holds pointers to a point. When I try to compile i keep geting the folllowing errors...
error C2143: syntax error : missing ';' before '<' error C4430: missing type specifier - int assumed. error C2238: unexpected token(s) preceding ';' error C2061: syntax error : identifier 'vector' error C2065: 'myPolygonPoints' : undeclared identifier error C2065: 'points' : undeclared identifier error C2065: 'myHasInstersection' : undeclared identifier error C2660: 'Polygon::addSetOfPoints' : function does not take 1 arguments
Here is the code to the class
#include "Point.h"
#include <vector>
class Point;
class Polygon
{
private:
vector<Point*> myPolygonPoints;
bool myHasIntersection;
public:
void addSetOfPoints(vector<Point*> points)
{
myPolygonPoints = points;
}
bool getHasIntersection()
{
return myHasIntersection;
}
void setHasIntersection(bool intersection)
{
myHasInstersection = intersection;
}
};
public
section first, then theprotected
, and finally theprivate
one. A user of the class is only interested by the first (and perhaps the second in case of inheritance) and could not care less about theprivate
one, so no need to have it in her eyes-path. – Matthieu M.