Scope for Public and Private

There is a piece of code:

1
2
3
4
5
6
7
8
9
10


    class BirdCarreau: public viscosityModel  // Private data
    {
       
    
            dictionary BirdCarreauCoeffs_;
    ...



Why this data which is inside this PUBLIC type is said to be private data?
Hi,

The public refers to public inheritance of a base class.

The BirdCarreauCoeffs_ is private because that is the default for classes.

One can use the access specifiers public: private: and protected inside the class to get what ever access level is required. Note that it is a good idea to have private member data.

You can look at the tutorial at the top left of this page for more info, there are 2 sections on classes.

Good Luck !!
Topic archived. No new replies allowed.