Hello, everybody
I am writing a program consists of three files main.cpp, and linklist.h and linklist.cpp. The code is not the final version cause I want to ensure this step first.
I believe that my problem is, in including the files, could you please check it and give you advice?
This is the first error:
request for member `select' in `list', which is of non-class type `linklist ()()'
do{
cout<< "Enter..." <<endl<< "1: to Add new dog"
<<endl<< "2: to Display the exist list"
<<endl<< "3: to Delete dog data"
<<endl<< "4: to Exit" <<endl<< "Your option is: ";
cin>> op;
list.select(op);
}while(cin.fail()!);
system("pause");
return 0;
}
//------ linklist.h ------
class linklist
{
public:
linklist();
void select(int);
private:
int opt;
};
//------ linklist.cpp ------
#include <iostream>
using namespace std;
no problem ;) just remember that you shouldn't write linklist list(); you only need the () when the constructor actually has paremeters, that was your problem ;)