class is used to declare classes—C++’s basic unit of encapsulation. Its general form is shown here:

 class class-name : inheritance-list {     // private members by default protected:     // private members that can be inherited public:     // public members } object-list; 

Here, class-name is the name of the new data type being generated by the class declaration. The inheritance-list, which is optional, specifies any base classes inherited by the new class. By default, members of a class are private. They may be made protected or public through the use of the protected and public keywords, respectively.

The object-list is optional. If not present, a class declaration simply specifies the form of a class. It does not create any objects of the class.


For additional information on class, see Chapter 1.

C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539

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