Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3
Yes..it is an important aspect of c++. It reduces lines of code by accessing private members of classes it is friend with..so no need to create different functions to access private members of different classes.. But it has some disadvantage too..like it violates the main concept of c++ that is “data hiding".. Friend functions might not be a good idea to use for projects or apps where security is most important like banking apps..
3rd Sep 2019, 6:17 PM
Alaska
Alaska - avatar