Hi everybody I am New to c++ programming..
I have written a code like like
class fruits
{
public:
int num;
public:
void color()
{
cout<<"the color is yellow:";
}
}f1;
main()
{
if(num==1)
f1.color();
else
cout<<"wrong number:";
}
here the variable "num"when i am using in main i am getting error although it has been declared as public variable.
can anybody tell me how to get out of the error????????