Main Menu

C++ help. :( Really, something's not working.

Started by Silverhawk79, October 18, 2007, 11:10:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Silverhawk79

#include <iostream>
class Point
{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;
};
class Rectangle
{ public:
   Rectangle (int top, int left, int right, int bottom);
   ~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 GetUpperRight() const {return itsUpperRight;}
   Point GetLowerLeft() const {return itsLowerLeft;}
   Point GetLowerRight() const {return itsLowerRight;}

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

    void SetTop (int top) {itsTop = top;}
    void SetLeft (int left) {itsLeft = left;)
    void SetRight (int right) {itsRight = right;}
   void SetBottom (int bottom) {itsBottom = bottom;} \

   int GetArea() const;

   private:
   Point itsUpperLeft;
   Point itsUpperRight;
   Point itsLowerLeft;
   Point itsLowerRight;
   int itsTop;
   int itsBottom;
   int itsLeft;
   int itsRight;


char response;
cin >> response;
return 0;
   };


This should work, but it doesn't.
The errors I get are these:
[C++ Error] rectangle.cpp(18): E2451 Undefined symbol 'itsTop'
[C++ Error] rectangle.cpp(19): E2451 Undefined symbol 'itsLeft'
[C++ Error] rectangle.cpp(20): E2451 Undefined symbol 'itsBottom'
[C++ Error] rectangle.cpp(21): E2451 Undefined symbol 'itsRight'
[C++ Error] rectangle.cpp(23): E2451 Undefined symbol 'itsUpperLeft'
[C++ Error] rectangle.cpp(24): E2451 Undefined symbol 'itsUpperRight'
[C++ Error] rectangle.cpp(25): E2451 Undefined symbol 'itsLowerLeft'
[C++ Error] rectangle.cpp(26): E2451 Undefined symbol 'itsLowerRight'
[C++ Error] rectangle.cpp(28): E2451 Undefined symbol 'itsUpperLeft'
[C++ Error] rectangle.cpp(29): E2451 Undefined symbol 'itsUpperRight'
[C++ Error] rectangle.cpp(30): E2451 Undefined symbol 'itsLowerLeft'
[C++ Error] rectangle.cpp(31): E2451 Undefined symbol 'itsLowerRight'
[C++ Error] rectangle.cpp(33): E2451 Undefined symbol 'itsTop'
[C++ Error] rectangle.cpp(34): E2451 Undefined symbol 'itsLeft'

WUT R WRONG :(

WiiGuy

what were you doing to get this? :|

Silverhawk79

Quote from: WiiGuy on October 18, 2007, 11:12:24 AM
what were you doing to get this? :|
Uh, taking my programming class?

WiiGuy


blue_slime


Quote from: blue_slime on October 18, 2007, 11:49:05 AM
why you unlocked this? :P
I choose to agree with this post that I have just now quoted.
...̅̅̅

Silverhawk79


blue_slime

#7
Personally, I haven't done C++, but did your Point class compile properly?  Your data members seem to be defined incorrectly as the error suggests.

Silverhawk79

Quote from: blue_slime on October 18, 2007, 12:08:18 PM
Personally, I haven't done C++, but did your Point class compile properly?  Your data members seem to be defined incorrectly as the error suggests.
Hm...ah, I figured it out. A ( was supposed to be a {. :P

blue_slime

Quote from: Silverhawk79 on October 18, 2007, 12:08:56 PM
Quote from: blue_slime on October 18, 2007, 12:08:18 PM
Personally, I haven't done C++, but did your Point class compile properly?  Your data members seem to be defined incorrectly as the error suggests.
Hm...ah, I figured it out. A ( was supposed to be a {. :P

Lol I hate those kinds of mistakes

Jono2

lol, C++.

don't worry.  you'll move on to C# next year and have to re-learn everything. :D

Quote from: LinkXLR on January 30, 2008, 09:10:54 PM
Quote from: famy on January 30, 2008, 08:36:30 PM
is big willy unleashed a will smith game

...I'm not even gonna touch this one.

SteamID: Lazylen