) 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
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
0
Explanation:
w6u62yigekeykeyiwyku4oeyurqu2tiyejrqyrqiyektwhqrhwtkyeloywiwyiyeoyei
Similar questions
Accountancy,
8 months ago
Science,
8 months ago
History,
1 year ago
Science,
1 year ago
History,
1 year ago
India Languages,
1 year ago