Hi I am getting the following error when i am trying to compile my code.
error C2143: syntax error : missing ‘;’ before ‘.’ when i call
Points.addPoints();
Thanks for any help.
#ifndef _POINTS_H
#define _POINTS_H
//points.h
#include <sstream>
using namespace std;
class Points{
int pointsADD;
int pointsRemove;
int newPoints;
public :
Points(int points){this->pointsADD=points;this->pointsRemove=pointsRemove;this->newPoints=newPoints;}
void addPoints(int newPointsADD){
newPoints=pointsADD+newPointsADD++;
}
void removePoints(int newPointsRemove){
newPoints=pointsRemove+newPointsRemove--;
}
int getPoints(){
return newPoints;
}
};
#endif
You need an instance of the class to add anything. Read a good C++ introduction, and fix for now: