23.2 Public and Private

I l @ ve RuBoard

Modules are divided into two parts , public and private . The public part tells the user how to call the functions in the module and contains the definitions of data structures and functions that are to be used from outside the module. The public definitions are put in a header file, which is included in the user 's program. In the infinite array example, we have put the public declarations in the file ia.h (see listing in Example 23-2).

Anything internal to the module is private. Everything that is not directly usable by the outside world should be kept private.

I l @ ve RuBoard


Practical C++ Programming
Practical C Programming, 3rd Edition
ISBN: 1565923065
EAN: 2147483647
Year: 2003
Pages: 364

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