In classes and objects i am using friend function! | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

In classes and objects i am using friend function!

why this friend doesn't work when i declared both data members n member function private?! i mean if i had to declare atleast members function public to use friend function then whats the use! then i can directly access private data members with public mem function!! so why friend doesn't work for both private data and function and only for general syntax of data members as private and mem function as public?

18th Sep 2018, 9:13 AM
Bunny
Bunny - avatar
0 Antworten