compiling error on C++
<p>can somebody please explain why can't I compile this snippet of the code? I know that this design is very bad, but I just want to know why I can't compile it, thanks in advance
P.S. sorry for the format, can't find backquotes on the panel</p>

<pre><code>//Deriving classes definition 
class IntClass; class DoubleClass;

//The Virtual Number Class. IntClass and FloatClass will derive from this class.

class Number {
    public:
        //return a Number object that's the results of x+this, when x is DoubleClass
        virtual Number&amp; addDouble(DoubleClass&amp; x) = 0;

        //return a Number object that's the results of x+this, when x is IntClass
        virtual Number&amp; addInt(IntClass&amp; x) = 0;

        //return a Number object that's the results of x+this, when x is either
        //IntClass or DoubleClass
        virtual Number&amp; operator+(Number&amp; x) = 0;
};

class IntClass : public Number {
    private:
        int my_number;
    public:
        //Constructor
        IntClass(int n):my_number(n) {}

        //returns the number stored in the object
        int get_number()  {return my_number;}

        //return a DoubleClass object that's the result of x+this
        Number&amp; addDouble(DoubleClass&amp; x){
         return  x.addInt(*this);
        }

        //return an IntClass object that's the result of x+this
        Number&amp; addInt(IntClass&amp; x){
         IntClass* var = new IntClass(my_number + x.get_number());
         return  *var;
        }

        //return a Number object that's the result of x+this.
        //The actual class of the returned object depends on x.
        //If x is IntClass, then the result if IntClass.
        //If x is DoubleClass, then the results is DoubleClass.
        Number&amp; operator+(Number&amp; x){
         return x.addInt(*this);
        }
};

class DoubleClass : public Number {
    private:
        double my_number;
    public:
        //Constructor
        DoubleClass(double n):my_number(n) {}

        //returns the number stored in the object
        double get_number()  {return my_number;}

        //return a DoubleClass object that's the result of x+this
        Number&amp; addDouble(DoubleClass&amp; x){
         DoubleClass* var = new DoubleClass(my_number + x.get_number());
         return *var;
        }

        //return a DoubleClass object that's the result of x+this
        Number&amp; addInt(IntClass&amp; x){
         DoubleClass* var = new DoubleClass(my_number + x.get_number());
         return *var;
        }

        //return a DoubleClass object that's the result of x+this.
        //This should work if x is either IntClass or DoubleClass
        Number&amp; operator+( Number&amp; x){
         return x.addDouble(*this);
        }
};
</code></pre>

<p>I have error in the IntClass in addDouble method: </p>

<pre><code>invalid use of undefined type struct DoubleClass
</code></pre>

<p><strong>Edited</strong> IntClass is not nested class of the NumberClass</p>
