Files
  • main.cpp
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>

class BorrowableItem {
  public:
  void checkOut() {std::cout << "BorrowableItem::checkOut" << std::endl;}
};

class ElectronicGadget {
  private:
  void checkOut() {std::cout << "ElectronicGadget::checkOut" << std::endl;}
};

class MP3Player: public BorrowableItem, public ElectronicGadget {

};

int main() {
  MP3Player mp;
  mp.checkOut();
  mp.BorrowableItem::checkOut();
  mp.ElectronicGadget::checkOut();
}
gcc version 4.6.3