I have a class defined as follows:
class main {
........
protected:
another_class *obj;
public:
void set_another_cla ss(another_clas s *ptr);
}
main::set_anoth er_class(anothe r_class *ptr)
{
obj = ptr;
}
When I try to compile this, it gives me the following error:
"'obj' : undeclared identifier
'=' : cannot convert from 'class another_class *' to 'int'
Could somebody let me know why I cannot set a protected member from a
public method?
And also suggestion for setting the "another_cl ass" pointer on "main".
Comment