i want to frd the MainControl with the derived class food
objects.h (abstract base)
#include "maincontrol.h"
class objects
{...};
food.h (derived)
#include "objects.h"
using namespace std;
class food: public objects
{...};
maincontrol.h
class objects;
class food;
class MainControl
{
public:
friend objects;
friend food;
...
};
MainControl::MainControl(char x)
{
switch(x)
{
case 'f': pointer = new food(...);break;
...
}
}
error C2514: 'food' : class has no constructors (line 15)
see declaration of 'food' (line 7)
is the error caused by friending MainControl with a derived class?