public:
multiple(int i1, int i2) : bar_1(i1), bar_2(i2) {}
void print() {
- cout << "bar_1::k -> " << bar_1::k << "\n";
- cout << "bar_2::k -> " << bar_2::k << "\n";
+ cout << "bar_1::k -> " << ((bar_1 *)this)->k << "\n";
+ cout << "bar_2::k -> " << ((bar_2 *)this)->k << "\n";
cout << "bar_1::get_k() -> " << bar_1::get_k() << "\n";
cout << "bar_2::get_k() -> " << bar_2::get_k() << "\n";
}
class derived: public base3, public base1, public base2 {
public:
int d_data;
- derived( int i ) { d_data = i; base3::b_data++; }
+ derived( int i ) { d_data = i; ((base3 *)this)->b_data++; }
void d_print() { }
};