Computer Science, asked by bhanu5158, 1 year ago

) Describe the mechanism of accessing data members and member function

in the following cases:

i) Inside the main program.

ii) Inside the member function of the same class.

iii) Inside the member function of another class.​

Answers

Answered by Anonymous
3

Answer:

Accessing a data member depends solely on the access control of that data member. If its public, then the data member can be easily accessed using the direct member access (.) operator with the object of that class.

If, the data member is defined as private or protected, then we cannot access the data variables directly. Then we will have to create special public member functions to access, use or initialize the private and protected data members. These member functions are also called Accessors and Mutator methods or getter and setter functions.

Answered by hdhirpara007
0

Explanation:

w6u62yigekeykeyiwyku4oeyurqu2tiyejrqyrqiyektwhqrhwtkyeloywiwyiyeoyei

Similar questions