If data members are private, what can we do to access them from the class object?
If data members are private, what can we do to access them from the class object? Correct Answer Create public member functions to access those data members
We can define public member functions to access those private data members and get their value for use or alteration. They can’t be accessed directly but is possible to be access using member functions. This is done to ensure that the private data doesn’t get modified accidentally.
মোঃ আরিফুল ইসলাম
Feb 20, 2025