New course! Every coder should learn Generative AI!
Try a free lesson0
why we use friend function in c++ ?
3 Answers
+ 3
A friend function can access private members (fields and methods) of the class it is a friend of.
0
cuz c++ is lonely
0
friend function can use private members of the class that IT is friend of