The friendship granted by a class A to a function or class B is _______ reciprocal, meaning [choose the correct statement].
- always
- occasionally
- one-way
- not
The friendship in C++ is one-way. If class A declares class B or a function as its friend, it doesn't mean that class A automatically becomes a friend of class B or that function. Friendship must be explicitly granted. This means the granting of friendship is not reciprocal by default. Class B or the function would need to separately declare class A as a friend for the reverse to be true.
Loading...
Related Quiz
- Some compilers detect tail recursion and optimize it through a technique known as _______.
- In what scenario might a program have a memory leak due to an exception being thrown?
- Which STL container provides constant time access to elements but may take linear time to insert a new element?
- How might you address concerns about function templates impacting compilation times and binary size in a high-performance scientific computing application?
- When a float is converted to an int, the value is _______.