class Oven
{
private:
int temperature;
public:
void cook(Food *somefood)
{
// preheat to temp that somefood needs
while(temperature<somefood.getneed())
{
Sleep(40);
temperature+=1;
cout<<"Preheat-temperature:"<<temperature;
}
}
void reset()
{
temperature=0;
}
};
Class Food:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
class Food
{
protected:
int temperature;
int needed;
public:
int getneed(){return needed;}
virtualvoid bakechem();
};
class Pizza:public Food
{
public:
Pizza()
{
temperature = 0;
needed = 250;
}
};
These classes are in different files. I get this error message when I compile, though.
'getneed' has not been declared
It is clearly declared, though! Help? I am passing an instance of class 'pizza' into 'oven.cook', by the way. It is not complete yet.