answersLogoWhite

0

Public members in C++ have accessibility to any function that has scope to the instance of the class, whereas private members have accessibility only to functions of that class.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is the philosophy that advocates public rather than private control of property?

Socialism advocates for public rather than private control of property. It believes that the means of production, distribution, and exchange should be owned or regulated by the community as a whole, rather than by private individuals.


Is the philosophy that advocates public rather than private control of property?

socialism.


Why do you think the members of the federal reserve board are appointed rather than elected?

The federal reserve is a private organization. Its members are appointed.


Why is it important in a public corporation rather than in a private corporation?

yes you are right


What is visibility mode what are the different inheritance visibility modes support by c plus plus?

There is no such thing as visibility mode in C++. Visibility is a function of information hiding but that relates to the way in which implementation details can be obfuscated within binary executables and libraries where only the interface need be exposed in a plain-text header file. This has nothing whatsoever to do with object oriented programming since information hiding is also possible in C. You probably meant access specifiers. There are three levels: private, protected and public. Private access limits access to the class and to friends of the class. Protected is the same as private but extends access to derivatives of the class. Public access imposes no limits. In terms of inheritance, the specified access level determines the accessibility of the protected and public members of the base class (private members are never inherited and will always remain private to the base class). in essence, members with access greater than the specified inheritance are reduced to the specified access. Thus if you specify protected inheritance, all public members of the base class become protected members of the derivative, while private inheritance reduces all public and protected members to private access. You may also reduce access to specific base class members simply be redeclaring them with the appropriate access.


How you declare class scoped variables and member functions?

To scope class members to the class (rather than to instances of the class), declare them as static members of the class. Static members are accessible even when no instances of the class exist. As such, static member functions do not have access to a 'this' pointer, unlike ordinary (nonstatic) member functions.


Why should children go to public school rather than private school?

Because it costs.


What is the difference between protected and friend in c plus plus?

The private, protected and public keywords are used to modify the access specifiers of class or struct members. Unless otherwise specified, class members are private by default, while struct members are public by default. Private members of a class are only accessible to members and to friends of that class. Protected members are the same as private members, but are also accessible to derived classes. Public members have unrestricted access. The private, protected and public access specifiers can also be used to modify the type of inheritance that applies to a derived class. Private inheritance means all public and protected members of the base class become private members of the derived class. Protected inheritance means all public members of the base class become protected members of the derived class. Public inheritance means all public and protected members of the base class remain public and protected members of the derived class. Private members of the base class are never inherited by derived classes. A derived class or one or more of its member functions may be declared a friend of the base class, thus permitting private access, but you would never do this unless the hierarchy were a closed, static hierarchy where all derivatives can be determined at compile time. Dynamically bound derivatives of unknown origin cannot be declared friends.


What is private placing?

A private placing is an issue of new shares to a restricted group of persons, such as institutions or high net worth private investors rather than the general public.


Is the us Air Force Academy a public or a private?

The US Air Force Academy is known as a public institution, rather than private. This school was founded in the year 1954 as a National Liberal Arts college.


Is arcadeprehacks illegal?

Its not; arcade prehacks is public and it doesn't interact with the website, normal hacks do. No because its just a public game hacked rather than private...


Which activity is part of civic rather than private life?

Voting in elections is an example of an activity that is part of civic life rather than private life. It involves participating in the governance of a community or country and is a responsibility that individuals have as members of society.