MCQOPTIONS
Bookmark
Saved Bookmarks
→
Technical MCQs
→
2D Transformation And Answers in Technical MCQs
→
What will be output for the followiing code?..
1.
What will be output for the followiing code?
A.
A::a=0
B.
A
C.
a=0
D.
A::0
Answer» B. A
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
Where does keyword ‘friend’ should be placed?
<pre class="result notranslate">class Box{ int capacity; public: void print(); friend void show(); bool compare(); friend bool lost();};</pre>7.Which keyword is used to represent a friend function?
<pre class="result notranslate">#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); }</pre>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