In this program i want to use the private visibility mode how i use the the private visibility mode??? And what change is occur? | Sololearn: Learn to code for FREE!

+2

In this program i want to use the private visibility mode how i use the the private visibility mode??? And what change is occur?

https://code.sololearn.com/cofuy8lNWx6m/?ref=app

6/12/2018 3:27:48 PM

Devang H Baroliya

2 Answers

New Answer

+8

default visibility mode in c++ classes is private so in your class definition of Class A int a is private and in class B int b and c is private and if you want to specify private by your self you can write private : just like you wrote public: and the change occur is if data is private than it can only be accessible inside the class definition.

+3

your ans is right but i use the private visibility and what change is occur in the program