answersLogoWhite

0


Best Answer

The access privileges in c++ are

1.public

2.private

3.protected

and by default its private

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

Protected access is exactly the same as private access, except that derived classes are also permitted access.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Define protected access modifire in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How does a class in c plus plus enforce data encapsulation?

Data encapsulation is enforced by restricting access to the class members. Access can be specified on a per-member basis, defaulting to private access for a class and public access for a struct. Private members are accessible to class members and to friends of the class. Protected members are the same as private members but are also accessible to derived class members. Public members are fully-accessible. Data members are typically declared private while interfaces are typically declared public or protected.


Which C plus plus keyword allows a function outside of a class to access private class members?

The keyword is friend. The external function must be declared a friend of the class (from within the class itself) in order to become a member of the class and thus gain access to the private (and protected) members of the class.


What is meant by private access in c plus plus?

It isn't. Private is the default access for class members. For struct members, the default access is public. Aside from default access, a class and a struct serve the same purpose; to define a class. As such, the following class definitions are equivalent: class X { int a; }; struct Y { private: int b; }; Typically, we use a struct to define simple data types with trivial construction and use class for more complex data types, often to encapsulate an invariant or to acquire a resource, hiding the implementation details from consumers using private access.


Is there a file concept in c plus plus?

No. The standard does not define nor require a file concept.


What is the default access specifier in C plus plus?

private

Related questions

Define protected in c plus plus?

Protected members are like private members, but are also accessible to derived classes.


What is friendly in c plus plus?

The keyword "friend" allows a function or variable to have access to a protected member inside a class.


How does a class in c plus plus enforce data encapsulation?

Data encapsulation is enforced by restricting access to the class members. Access can be specified on a per-member basis, defaulting to private access for a class and public access for a struct. Private members are accessible to class members and to friends of the class. Protected members are the same as private members but are also accessible to derived class members. Public members are fully-accessible. Data members are typically declared private while interfaces are typically declared public or protected.


Which C plus plus keyword allows a function outside of a class to access private class members?

The keyword is friend. The external function must be declared a friend of the class (from within the class itself) in order to become a member of the class and thus gain access to the private (and protected) members of the class.


In the US works created after 1977 are protected for the life of the author plus years?

Works are protected for the life of the author plus 70 years in the US.


What is meant by private access in c plus plus?

It isn't. Private is the default access for class members. For struct members, the default access is public. Aside from default access, a class and a struct serve the same purpose; to define a class. As such, the following class definitions are equivalent: class X { int a; }; struct Y { private: int b; }; Typically, we use a struct to define simple data types with trivial construction and use class for more complex data types, often to encapsulate an invariant or to acquire a resource, hiding the implementation details from consumers using private access.


Different access specifies in C plus plus?

Public members and methods of a class are universally accessible. Protected members and methods of a class are accessible to methods of instances of that class and its derived classes. Private members and methods of a class are accessible only to methods of instances of that class.Class A has three members: public_member, protected_member, and private_member, which have access corresponding to their names. Class A has access to all three. Class B, derived from class A, has access to public_member and protected_member, but not private_member. Unrelated class C has access only to public_member.


Is there a file concept in c plus plus?

No. The standard does not define nor require a file concept.


How do you find a largest algorithm in c plus plus?

#define max (a, b) ((a) >= (b)) ? (a) : (b)


What is the answer for 4x plus 60 equals 4x plus 5?

The answer is that there is no such x - unless you define "plus" in some special way.


How do you get all the Pokemon legendarie s in pearl without migrating and action replay?

yes, but you need the code for the Pokemon modifire, it is everywhere on the internet now but to get it to work you have to type it in manually, not with the computer. plus it helps to haye the 9999 masterballs cheat because that is what runs the cheat. p.s the Pokemon platinum Pokemon modifire screws with your game and restarts it, so don't even try


What is the default access specifier in C plus plus?

private