MCQOPTIONS
Bookmark
Saved Bookmarks
→
Technical MCQs
→
2D Transformation And Answers
→
A friend function can be
1.
A friend function can be
A.
A method of another class
B.
A global function
C.
Both A and B
D.
None of the above
Answer» D. None of the above
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
Where does keyword ‘friend’ should be placed?
class Box{ int capacity; public: void print(); friend void show(); bool compare(); friend bool lost();};7.Which keyword is used to represent a friend function?
#include <iostream>class A { private: int a; public: A() { a = 0; } friend class B; // Friend Class }; class B { private: int b; public: void showA(A& x) { std::cout << ""A::a="" << x.a; } }; int main() { A a; B b; b.showA(a); }6.What will be output for the following code?
What will be output for the followiing code?
If class A is a friend of B, then B doesn’t become a friend of A automatically.
A friend function can be
A friend class can access ____________________ members of other class in which it is declared as friend.
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies