i got a project due tomorrow dealing with inheritence and i seem to have hit a brick wall. the errors are:
c:\documents and settings\johnnyg\my documents\visual studio 2005\projects\project 8\project 8\Cube.h(4) : error C2504: 'Rectangle' : base class undefined
.\Cube.cpp(5) : error C2511: 'Cube::Cube(void)' : overloaded member function not found in 'Cube'
c:\documents and settings\johnnyg\my documents\visual studio 2005\projects\project 8\project 8\Cube.h(3) : see declaration of 'Cube'
rectangle is a declared class
if needed here it is:
Code:
class Rectangle
{
public:
Rectangle(double=0.0,double=0.0);
double getWidth();
double getLength();
double getArea();
private:
double width;
double length;
};
the cube class is here:
Code:
class Cube : public Rectangle
{
public:
Cube(double=0.0);
double getHeight();
double getVolume();
private:
double height;
double volume;
};
and the cpp where the 2nd error occurs
Code:
#include "Cube.h"
Cube::Cube(double height=0.0)
{
}
double Cube::getHeight()
{
return height;
}//height
double Cube::getVolume()
{
double volume;
volume=height*height*height;
return volume;
}//getvolume
if anyone can help would really appreciate it thanks in advance