errors.. errrors.. more errors

This is a discussion on errors.. errrors.. more errors within the C++ Programming forums, part of the General Programming Boards category; Eg. Code: class DOG { public: int GetAge(); virtual ~Dog(); private: int Age; }; Nothing can access 'Age' except the ...

  1. #16
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788
    Eg.
    Code:
     
    class DOG 
    {
    public:
            int GetAge();
            virtual ~Dog();
    private:
            int Age;
    };
    Nothing can access 'Age' except the member function GetAge().
    Even derived classes won't have access to 'Age'.
    To give acces to derived classes, 'private' should be changed to 'protected'

  2. #17
    Seeking motivation... endo's Avatar
    Join Date
    May 2002
    Posts
    537
    Originally posted by Klinerr1
    i need the varibles in that class thing to be noticed before int main(); will it work the same way
    wut does if it is grpahical mean?
    If you are planning on making your program with graphics, then you will need a draw( ) function to draw the object to the screen. I wouldn't worry about it, it doesn't seem like your planning on doing this.

  3. #18
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608
    so dont use that line?
    Email: Klinerr1@nc.rr.com || AIM: MisterSako || MSN: sakotheinsane@hotmail.com

    -the shroom has spoken

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. global namespace errors
    By stubaan in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2008, 03:11 PM
  2. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 10:50 AM
  3. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM
  4. Help me with these errors... :-(
    By major_small in forum C++ Programming
    Replies: 6
    Last Post: 09-07-2003, 08:18 PM
  5. errors in class(urgent)
    By ayesha in forum C++ Programming
    Replies: 2
    Last Post: 11-10-2001, 05:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21