When I try to compile this code
using namespace std;
#include <iostream>
class COne{
protected:
int a;
public:
bool is_equil( COne & other){
if ( a == other->a)
return 1;
else
return 0;
};
int seta(int val){
a = val;
return 0;
};
};
int main(){
COne a, b;
a.seta(5);
b.seta(3);
cout << "result is: " << a.is_equil(b) << endl;
b.seta(5);
cout << "result is: " << a.is_equil(b) << endl;
return 0;
}
I get the following error
"Base operand of '->' has non-pointer type COne"
Why is it? I am probably missing something very simple here.