
-----------------------------------
Geminias
Thu Nov 03, 2005 5:55 pm

Program bug
-----------------------------------
my compiler gives me an error at line 35 or so.  i put a comment right beside where the error is.. i keep running into this error when i make classes and i have no idea what is wrong.  any help would be appreciated.



syntax= c++

#include 
using namespace std;

enum Choice {
     DrawRect = 1, GetArea, GetPerim, ChangeDimensions, Quit  };
     
     //rectangle class declaration
     
     class Rectangle 
     {
           public:
                  //constructors Rectangle (int width, int height);
                  ~Rectangle();
                  
                  // accessors
           int GetHeight() const { return itsHeight; }
           int GetWidth() const { return itsWidth; }
           int GetArea() const {return itsHeight * itsWidth; }
           int GetPerim() const { return 2*itsHeight + 2*itsWidth; }
           void SetSize (int newWidth, int newHeight);
           
           // Misc. methods
           private:
                   int itsWidth;
                   int itsHeight;
                   };
                   //Class method implementations
                   void Rectangle::SetSize(int newWidth, int newHeight)
                   {
                   itsWidth = newWidth;
                                         itsHeight = newHeight;
                   }
                                               
           Rectangle::Rectangle (int width, int height)      /* here is where
           i get an error saying: prototype for 'Rectangle::Rectangle(int,int)'
           does not match any in class 'Rectangle' */
     {
     itsWidth = width;
                itsHeight = height;
                  }
           
           Rectangle::~Rectangle() {}
           
           int DoMenu();
           void DoDrawRect (Rectangle);
           void DoGetArea(rectangle);
           void DoGetPerim (Rectangle);
           
           /*==========================================*/
           int main ()
           {
                    //initialize a rectangle to 30,5
                    
                    Rectangle theRect(30,5);
                    
                    int choice = DrawRect;
                    int fQuit = false;
                    while (!fQuit)
                    {
                          choice = DoMenu();
                          
                          if (choice < DrawRect || choice > Quit)
                    {
                           cout 