Heres my error...
"In constructor 'NumGame::NumGame(int&)': error: no matching function for call to 'Category::Category()'"
Ive looked at a few similar questions here but cant seem to find an answer. I have a base class Category and NumGame is inherited from it but wont compile.
class Category {
public:
void virtual selection(int&);
Category(int&);
virtual ~Category(){};
private:
int myRandNum;
};
Category::Category(int& a){
myRandNum = a;
}
void Category::selection(int& a){
cout << "I am NumGame version number... " << a << endl;
cout << "Now Im playing... " << myRandNum << endl;
}
class NumGame : public Category {
public:
void selection(int&);
NumGame(int&);
~NumGame(){};
private:
int myRandNum;
};
NumGame::NumGame(int& b){
myRandNum = b;
}
void NumGame::selection(int& b) {
}
See Question&Answers more detail:os