Подскажите как добавить функции из другого класса, в данном случае Fraction
[CODE=cpp]
#include <stdafx.h>
#include <conio.h>
#include "Fraction.h"
using namespace std;
class FloatFraction : public Fraction {
public:
double get_float() {
return static_cast<double>(get_num())/get_den();}
void set_float(double x);
};
int main() {
FloatFraction fract1;
fract1.set_float(0.5);
cout << "Value of 0.5 is " << fract1.get_float() << endl;
fract1.set_float(0.6);
cout << "Value of 0.6 is " << fract1.get_float() << endl;
return 0;
}
void FloatFraction::set_float(double x) {
int new_val = static_cast<int>(x * 100.0);
set(new_val, 100);
}
[/CODE]