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 ?
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~
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.
public:
can be accessed anywhere
private:
can be accessed only by the class
protected:
can be accessed only by the class and subclasses
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
Lol, yup those books dont explain themselves very much.
What is C++?
virtual
Virtual Inheritance, nasty.
thanx all~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
but I still confused with private and protected. what the difference in detail plz ???
Last edited by black; 06-17-2002 at 09:17 PM.
Never end on learning~
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~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.
Never end on learning~