what is the use of friend function?? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

what is the use of friend function??

10th Sep 2016, 12:57 PM
Sahibe Alam
Sahibe Alam - avatar
2 ответов
+ 6
A friend function can access private and protected members of a class. You can also use a static function rather than a friend one for the same purpose, there is not much difference (except that a static function belongs to the class).
10th Sep 2016, 1:10 PM
Zen
Zen - avatar
+ 1
actually friend function are the functions which are not declared in a class but it can access by the class .
13th Sep 2016, 1:42 PM
Twinkle Baisane
Twinkle Baisane - avatar