want to get something more about class~

This is a discussion on want to get something more about class~ within the C++ Programming forums, part of the General Programming Boards category; Hi,folks~ I am checking the class chapter of my book. it says I could use 2 preserved words public and ...

  1. #1
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563

    Question want to get something more about class~

    Hi,folks~

    I am checking the class chapter of my book. it says I could use 2 preserved words public and private. and are there any other preserved words ?
    Never end on learning~

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    There's also protected.

    Public - any function can access it.
    Private - only member functions and friends.
    Protected - member functions, friends and its derived classes.

    Check out MSDN for more detailed descriptions of each.

  3. #3
    Unregistered
    Guest
    public:
    can be accessed anywhere

    private:
    can be accessed only by the class

    protected:
    can be accessed only by the class and subclasses

  4. #4
    Registered User billholm's Avatar
    Join Date
    Apr 2002
    Posts
    225

    Lightbulb

    Yah they already said everything.

    You can do it kid. Go go go!
    All men are created equal. But some are more equal than others.

    Visit me at http://www.angelfire.com/my/billholm

  5. #5
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Lol, yup those books dont explain themselves very much.
    What is C++?

  6. #6
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    virtual

    Virtual Inheritance, nasty.

  7. #7
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563
    Originally posted by Unregistered
    public:
    can be accessed anywhere

    private:
    can be accessed only by the class

    protected:
    can be accessed only by the class and subclasses
    thanx all~

    but I still confused with private and protected. what the difference in detail plz ???
    Last edited by black; 06-17-2002 at 10:17 PM.
    Never end on learning~

  8. #8
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    well protected you can access from classes derived from it. If you don't understand derived classes or friend classes or stuff, www.cplusplus.com has GREAT tutorials on beginning level OOP.

  9. #9
    flashing vampire black's Avatar
    Join Date
    May 2002
    Posts
    563

    Thumbs up

    Originally posted by frenchfry164
    well protected you can access from classes derived from it. If you don't understand derived classes or friend classes or stuff, www.cplusplus.com has GREAT tutorials on beginning level OOP.
    Hey, man ! that's just what I want. thanx~
    Never end on learning~

Popular pages Recent additions subscribe to a feed

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