public access specifier

   
public access specifier No restrictions on member access

  access-specifier  := public 

The public keyword can be used within a class definition (followed by a colon ) to mark subsequent member declarations as public or before a base-class name in the class header to mark the inheritance as public. The default access level of a struct is public, both for members and base classes.

Public members can be used freely by any other class or function.

Public inheritance means all members of the base class retain their accessibility levels.

See private for an example.

See Also

class , private , protected , struct , Chapter 6

   


C++ in a Nutshell
C++ in a Nutshell
ISBN: 059600298X
EAN: 2147483647
Year: 2005
Pages: 270
Authors: Ray Lischner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net