我有以下情况:
class num {
public:
void print(ostream* o); // Prints the n variable
};
class int_num : public num{
public:
int n; // Initialized by this class's constructor
};
class float_num : public num{
public:
float n; // Initialized by this class's constructor
};
class double_num : public num{
public:
double n; // Initialized by this class's constructor
};
我如何实施这样的计划