View Single Post
Old 08-13-2002, 02:36 PM   #1 (permalink)
w00t
Totally Inept
 
w00t's Avatar
 
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
w00t is on a distinguished road
If you can find the bug in this, you are a genius

On line 28 , which reads:

Point GetUpperLeft()const { return itsUpperLeft; }

I get an error that states "type name expected"
and also "declaration missing ; "
I've been going over this for a while now and I just can't find this stupid little bug Please enlighten me

Here's the full program:

Code:
// Begin Rect.hpp
#include <iostream.h>
class point  //holds x,y coordinates
{
  //no constructor, use default
  public:
    void SetX(int x) {itsX = x; }
    void SetY(int y) {itsY = y; }
    int GetX()const {return itsX;}
    int GetY()const {return itsY;}
  private:
    int itsX;
    int itsY;
};  //end of point class declaration


class Rectangle
{
  public:
    Rectangle (int top, int left, int bottom, int right);
    ~Rectangle () {}

    int getTop() const { return itsTop; }
    int getLeft() const { return itsLeft;}
    int getBottom() const { return itsBottom; }
    int getRight() const { return itsRight; }

    Point GetUpperLeft()const { return itsUpperLeft; }
    Point GetLowerLeft()const { return itsLowerLeft; }
    Point GetUpperRight()const { return itsUpperRight; }
    Point GetLowerRight()const { return itsLowerRight; }

    void SetUpperLeft(Point Location)  {itsUpperLeft = Location;}
    void SetLowerLeft(Point Location)  {itsLowerLeft = Location;}
    void SetUpperRight(Point Location)  {itsUpperRight = Location;}
    void SetLowerRight(Point Location)  {itsLowerRight = Location;}

    void SetTop(int Top)  {itsTop = Top;}
    void SetLeft(int Left) {itsLeft = Left;}
    void SetBottom(int Bottom) {itsBottom = Bottom;}
    void SetRight(int Right)  {itsRight = Right;}

    int GetArea() const;

    private:
      point itsUpperLeft;
      point itsUpperRight;
      point itsLowerLeft;
      point itsLowerRight;
      int  itsTop;
      int  itsLeft;
      int  itsBottom;
      int  itsRight;
};
  //end Rect.hpp
Please pardon my stupidity, I'm a n00b.
__________________
Office Space:
Best Movie.
Ever.

Contrary to popular belief, the true function of a programmer
is to turn coffee into source code.
w00t is offline   Reply With Quote