Sorry if this sounds kind of dumb, but are you saying that if I use private inheritance then the child class will not inherit any of its parents variables?
Also , I'm still having problems with these pointers. Once again the notes I got don't cover dynamic objects created within objects. I guess maybe I need a book :P
I'm trying to get the pointer to the guest staying in a room. Heres my get member function:
And heres where I call it:Code:guests rooms::GetGuest(){return *p;}
When I run the prog I get this error at the IF statement:Code:void CheckAvail(rooms *room) { for(int i=1; i<=num_rooms; i++) { cout << "Room: " << room[i].GetNumber() << " \tat $" << room[i].GetCost() << "\t"; if(room[i].GetGuest() != NULL) cout << "Booked\n"; else cout << "Vacant\n"; } }
Could someone please point out whats wrong here. Thx.Code:no match for 'operator!=' in 'rooms::GetGuest()() != 0'



LinkBack URL
About LinkBacks
. Once again the notes I got don't cover dynamic objects created within objects. I guess maybe I need a book :P 



CornedBee