Accessing Inherited Functions

  • + 1 comment

    Solve it:

    class D: public A, public B, public C
    {
    ...
    		 //Implement this function
    		 void update_val(int new_val)
    		 {
                while (new_val % 5 == 0){
                    new_val /= 5;
                    C::func(val);
                }
                while (new_val % 3 == 0){
                    new_val /= 3;
                    B::func(val);
                }
                while (new_val % 2 == 0){
                    new_val /= 2;
                    A::func(val);
                }
    		 }
    ...
    };