//this is the class that I must declare to be public
class Zoo
{
private:
//create 4 pointers to instances of house class
Animal *M;
Animal *C;
Animal *D;
Animal *L;
};
// constructor
Zoo::Zoo()
{
Animal *M;= new Animal();
char M[64];
strcpy(M, "Monkey");
M->SetHouseName(M);
Animal *C; = new Animal();
char R[64];
strcpy(C, "Cat");
C->SetHouseName(C);
Animal *D;= new Animal();
char D[64];
strcpy(D, "Dog");
D->SetHouseName(D);
Animal *L; = new Animal();
char L[64];
strcpy(L, "Lion");
L->SetHouseName(L);
}
For the constructor I recieve 4 errors stating redefinition; different types of indirection. I don't understand why I am recieving it and for the deconstrutor I have: which I highly expect for it to be wrong. Feedback would be great!
Animal ::~Animal ()
{
delete *M, *C, *D, *L;
}