Computer Science 1037A/B Lecture Notes - Lecture 25: Function Prototype

22 views1 pages

Document Summary

Friend function: a function that is not a member of a class, but has access to private members of the class. A friend function can be a stand-alone function or a member function of another class. It is declared a friend of a class with the friend keyword in the function prototype. Friend function may be a member of another class. An entire class can be declared a friend of a class. If frclass is a friend of aclass, then all member functions of frclass have unrestricted access to all members of aclass, including the private members. In general, restrict the property of friendship to only those functions that must have access to the private members of a class.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents