Friend « Class « C++






1.Friend function DemoFriend function Demo
2.Make the inserter into a friend functionMake the inserter into a friend function
3.Define friend function for <<Define friend function for <<
4.friend class for each other
5.Friends can access private members of a class.
6.Use friend function to access the non-public member variable