public

What does mean public???
1
2
3
4
5
6
7
class
{
public:
  // Somethign here
private:
  // Something here
};


Public members of a class are accessible to outside. Private members can only be used from inside the class. It's a way to prevent people from messing with the internal workings of a class and only giving them access to what the class is designed to output.
Thanks!!!
Friend and protected could be helpful too.

http://www.cplusplus.com/doc/tutorial/inheritance/
Topic archived. No new replies allowed.