0
How to modify a private data member of a class through a non member function?
pls guys help me in this question I am in very urgent of this answer.
1 Réponse
+ 2
You can use friend functions. They can access private variables of the class, but they are not member functions. I wrote an example for you to look at, but there is also a lesson on friends under the "More on Classes" section of the C++ unit.
https://code.sololearn.com/ciKc8PDBE5W9/?ref=app