22 lines
450 B
C++

#ifndef EXAMPLE11_ROOM_H
#define EXAMPLE11_ROOM_H
#include <iostream>
class Room {
private:
std::string name;
public:
Room(std::string name) : name(name) {
std::cout << "Room::constructor" << std::endl;
}
virtual ~Room() {
std::cout << "Room::destructor" << std::endl;
}
virtual void print() const {
std::cout << "Room " << name << std::endl;
}
};
#endif //EXAMPLE11_ROOM_H