OOPortal OOPortal

Operator Overloading  «Prev

Friend functions in C++ - Quiz

Each question is worth one point. Select the best answer or answers for each question.
1. A friend function declaration:
  A. gives nonmember functions access to hidden class members
  B. is another term for an overloaded function within a class
  C. is any function created for you by the compiler (such as a default constructor)
  D. is any function outside the class with the same name as a function in the class

2. A friend function declaration appears:
  A. in the header of the friend function outside the class
  B. inside the class declaration to which it is a friend
  C. as a separate declaration inside main()
  D. anywhere prior to the function invocation
Score =
Correct answers: