answersLogoWhite

0


Best Answer

In C++, the private specifier means that the item can only be accessed by methods of the class, not including methods of derived classes. Protected, on the other hand, means the item can be accessed by methods of the class, and methods of derived classes. Public, to complete the explanation, means that the item can be acessed by any method, this class, another class, or otherwise.

User Avatar

Wiki User

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

Wiki User

10y ago

Private members of a class are only accessible to the class itself and to friends of the class. Protected members are the same as private members, but are also accessible to derivatives of the class. Public members are fully accessible. Note that protected member variables should be avoided as much as possible, as this can easily undermine the encapsulation of those members.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

There is no private or protected specifier in C. It is a C++ concept.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Private members are accessible to the class and friends of the class. Protected members are also accessible to derived classes.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference between private and protected specifier in c plus plus language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between access specifier and access modifier?

An access modifier is another name for an access specifier, which in object-orientated software is a keyword applied to a variable which indicates which other parts of the programme are permitted to access it.


Explain the significance of public and protected and private access specifiers in inheritance?

These are all access modifiers in Java. a. Public - these are accessible anywhere. This is the least restrictive access specifier. b. Private - these are accessible only inside the declaring class. This is the most restrictive access specifier. c. Protected - these are in between public and private. These are accessible to all classes that inherit this class d. Package - this is the default access specifier. These are accessible to all classes that are present in the same package as the contained class.


WHAT IS THE DIFFERENCE BETWEEN LANGUAGE AND COMMUNICATION I NEED RARE ANSWERS ONLY?

what is the difference between speech,language and communication??There is a huge difference between language and communication


What is the difference between language and culture?

Language refers to the system of communication using words and rules for their use, while culture encompasses the beliefs, customs, and traditions of a group of people. Language is a key component of culture as it reflects and shapes cultural identity and values. Language is one aspect of culture, alongside other elements such as art, music, religion, and social behaviors.


What is the difference between a baloch and brohi?

there is between language


What is the difference between English language and Italian language?

English and Italian belong to different language families, with English being a Germanic language and Italian being a Romance language. They have different grammar structures, vocabularies, and phonetic systems. English is spoken by more people worldwide compared to Italian.


What are the differences between urdu and English language?

wht is the basic difference between English language with urdu language


What is the difference between speaking and language?

Speaking refers to the act of verbal communication through vocal sounds, while language encompasses a broader system of communication that includes speaking, writing, gestures, and symbols used by a community of people. Language involves rules, grammar, and syntax that govern the organization of words and meanings.


What is the basic difference between speech and written communication?

Speech communication involves the verbal exchange of information through spoken words, while written communication conveys messages through written text. Speech is immediate and allows for real-time interaction, while written communication offers a permanent record that can be referenced later. Both forms have their own strengths and weaknesses in terms of clarity, tone, and audience engagement.


How do you tell the difference between National and Provincial parks?

There is no real difference but National parks are operated and protected by the Canada's parks while Provincial parks are operated and protected by the provinces that they are in.


What is the difference between the Norman French and Parisian French?

Norman French refers to the variety of Old French spoken in the Norman region of France, which influenced the English language after the Norman Conquest in 1066. Parisian French, on the other hand, is the standard French spoken in Paris and considered the prestige dialect in France. While both share similarities, Norman French has distinct phonetic and lexical differences compared to Parisian French.


What are the difference between Spanish and English subjects?

Language.