In C++, the $friend$ keyword allows a class or function to access the private and protected members of another class. When one class (let's call it Class A) declares another class (Class B) as its $friend$, it grants specific access privileges.
The declaration of friendship is asymmetric. When Class A declares Class B as a friend:
Therefore, the correct statement is that all member functions of the class granted friendship have unrestricted access to the members of the class granting the friendship.
Match List I with List II
| List I | List II | ||
| (Programming Paradigm) | (Characteristic) | ||
| A. | Imperative | I. | Declarative, clausal representation, theorem proving |
| B. | Object‐oriented | II. | Side‐effect free, declarative, expression evaluation |
| C. | Logic | III. | Imperative, abstract data type |
| D. | Functional | IV. | Command‐based, procedural |
Choose the correct answer from the options given below :
Let A be the base class in C++ and B be the derived class from A with protected inheritance. Which of the following statement is false for class B?
A member function can always access the data in _______, (in C++).
Which of the following is not correct for virtual function in C++?
Which of the following is correct (in C++)?