|
 |
|
 |
08-13-2002, 02:36 PM
|
#1 (permalink)
|
|
Totally Inept
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
|
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.
|
|
|
08-13-2002, 06:05 PM
|
#2 (permalink)
|
|
Totally Inept
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
|
No genui in here eh?:p
__________________
Office Space:
Best Movie.
Ever.
Contrary to popular belief, the true function of a programmer
is to turn coffee into source code.
|
|
|
08-13-2002, 06:08 PM
|
#3 (permalink)
|
|
Legend in my own mind
Join Date: May 2002
Location: florida
Posts: 618
|
ive been scanning it for bout 20 min and i dont see it either, but im a n00b too 
__________________
Is it me or does the word abbreviation seem a little long?
registered user #193524 with the Linux Counter,
http://counter.li.org
|
|
|
08-13-2002, 07:59 PM
|
#4 (permalink)
|
|
bloomberg
Join Date: Jun 2002
Location: bloomberg
Posts: 263
|
Code:
class point //note the case sensitivty "point"
Point GetUpperLeft()const { return itsUpperLeft; } //< where is trhe "Point" datatype???
/*
i assume its meant to be "point" not "Point"
*/
maybe that is the problem, but i could be wrong, the first time i looked at c++ was last night and i was reading from the same book as you 
__________________
-- bloomberg.
|
|
|
08-13-2002, 08:01 PM
|
#5 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,444
|
and what book is this? is it good?
|
|
|
08-13-2002, 08:10 PM
|
#6 (permalink)
|
|
bloomberg
Join Date: Jun 2002
Location: bloomberg
Posts: 263
|
learn c++ in 21 days
seems okay, i only looked at it for about 30 minutes but it seems fine so far
__________________
-- bloomberg.
|
|
|
08-13-2002, 08:13 PM
|
#7 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,444
|
hehe, that is the text for my c++ class too. it's ok .. i just have to read it really slow sometimes .. around chapter 10 or so.
|
|
|
08-13-2002, 08:13 PM
|
#8 (permalink)
|
|
Totally Inept
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
|
C++ in 21 days
Yeah, it's an OK book but are there any others out there that you could reccomend to me?
__________________
Office Space:
Best Movie.
Ever.
Contrary to popular belief, the true function of a programmer
is to turn coffee into source code.
|
|
|
08-13-2002, 08:16 PM
|
#9 (permalink)
|
|
bloomberg
Join Date: Jun 2002
Location: bloomberg
Posts: 263
|
www.bruceeckel.com has probably the best book for java (in my opionion) and a similiar book for c++, but the c++ book hasn't helped me (i only looked at it for 5 minutes) and i think it requires a basic understand, or bit above, which i dont have, but it may be good as well
thinking in c++ is its names
__________________
-- bloomberg.
|
|
|
08-13-2002, 08:36 PM
|
#10 (permalink)
|
|
bloomberg
Join Date: Jun 2002
Location: bloomberg
Posts: 263
|
so am i a genuis w00t?
__________________
-- bloomberg.
|
|
|
08-13-2002, 08:42 PM
|
#11 (permalink)
|
|
Totally Inept
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
|
O.k, i solved that problem (thanks abc), but now an even more obscure problem has popped up:
undefined symbol _main in module co.asm
now THAT's an error...
__________________
Office Space:
Best Movie.
Ever.
Contrary to popular belief, the true function of a programmer
is to turn coffee into source code.
|
|
|
08-13-2002, 08:42 PM
|
#12 (permalink)
|
|
Totally Inept
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
|
Not until you solve the above quandry... 
__________________
Office Space:
Best Movie.
Ever.
Contrary to popular belief, the true function of a programmer
is to turn coffee into source code.
|
|
|
08-13-2002, 08:46 PM
|
#13 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,444
|
*whistles the jepordy theme .. *
|
|
|
08-13-2002, 08:50 PM
|
#14 (permalink)
|
|
bloomberg
Join Date: Jun 2002
Location: bloomberg
Posts: 263
|
well i solved one problem and you didn't even post any assembly code... so there.. 
__________________
-- bloomberg.
|
|
|
08-13-2002, 09:52 PM
|
#15 (permalink)
|
|
Totally Inept
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
|
Well, I think it was a compiler error because the next program I wrote had the same error message. I'll just reinstall the compiler (Borland 5.5).
__________________
Office Space:
Best Movie.
Ever.
Contrary to popular belief, the true function of a programmer
is to turn coffee into source code.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 04:08 PM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|