Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > Standard C, C++

Reply
 
LinkBack Thread Tools Display Modes
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
Old 08-13-2002, 06:05 PM   #2 (permalink)
w00t
Totally Inept
 
w00t's Avatar
 
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
w00t is on a distinguished road
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.
w00t is offline   Reply With Quote
Old 08-13-2002, 06:08 PM   #3 (permalink)
revolution
Legend in my own mind
 
revolution's Avatar
 
Join Date: May 2002
Location: florida
Posts: 618
revolution is on a distinguished road
Send a message via AIM to revolution
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
revolution is offline   Reply With Quote
Old 08-13-2002, 07:59 PM   #4 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
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.
abc123 is offline   Reply With Quote
Old 08-13-2002, 08:01 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
and what book is this? is it good?
sde is offline   Reply With Quote
Old 08-13-2002, 08:10 PM   #6 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
learn c++ in 21 days


seems okay, i only looked at it for about 30 minutes but it seems fine so far
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-13-2002, 08:13 PM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
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.
sde is offline   Reply With Quote
Old 08-13-2002, 08:13 PM   #8 (permalink)
w00t
Totally Inept
 
w00t's Avatar
 
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
w00t is on a distinguished road
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.
w00t is offline   Reply With Quote
Old 08-13-2002, 08:16 PM   #9 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
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.
abc123 is offline   Reply With Quote
Old 08-13-2002, 08:36 PM   #10 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
so am i a genuis w00t?
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-13-2002, 08:42 PM   #11 (permalink)
w00t
Totally Inept
 
w00t's Avatar
 
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
w00t is on a distinguished road
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.
w00t is offline   Reply With Quote
Old 08-13-2002, 08:42 PM   #12 (permalink)
w00t
Totally Inept
 
w00t's Avatar
 
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
w00t is on a distinguished road
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.
w00t is offline   Reply With Quote
Old 08-13-2002, 08:46 PM   #13 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
*whistles the jepordy theme .. *
sde is offline   Reply With Quote
Old 08-13-2002, 08:50 PM   #14 (permalink)
abc123
bloomberg
 
abc123's Avatar
 
Join Date: Jun 2002
Location: bloomberg
Posts: 263
abc123 is on a distinguished road
Send a message via AIM to abc123 Send a message via Yahoo to abc123
well i solved one problem and you didn't even post any assembly code... so there..
__________________
-- bloomberg.
abc123 is offline   Reply With Quote
Old 08-13-2002, 09:52 PM   #15 (permalink)
w00t
Totally Inept
 
w00t's Avatar
 
Join Date: Jul 2002
Location: The Great Northwest
Posts: 195
w00t is on a distinguished road
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.
w00t is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Couln't find any template, giving up infinite_root PHP 5 05-25-2004 08:07 PM
CodeNewbie helps detect Konquerer Bug . . . sde Lounge 1 02-19-2004 01:22 AM
bug anon Feedback 10 01-12-2003 03:30 PM


All times are GMT -8. The time now is 04:08 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting