#include #include #include "cowboybank.h" using namespace std; int main() { cowboybank cbb(10, 20, 30); cbb.chew(); //inherited from cowboy cbb.deposit(); //inherited from bank cbb.run(); //introduced in cowboybank //cbb.draw(); //won't compile: ambiguous cbb.cowboy::draw(); //the draw inherited from cowboy cbb.bank::draw(); //the draw inherited from bank cout << "\n" << &cbb << " == &cbb\n" << static_cast(&cbb) << " == addr of cowboy in cbb\n" << static_cast(&cbb) << " == addr of bank in cbb\n" << reinterpret_cast(&cbb) << "\n"; return EXIT_SUCCESS; }