Answer Posted / mital
A friend function is used in object-oriented programming to
allow access to private or protected data in a class from
outside the class. Normally a function which is not a
member of a class cannot access such information; neither
can an external class. Occasionally such access will be
advantageous for the programmer; under these circumstances,
the function or external class can be declared as a friend
of the class using the friend keyword. The function or
external class will then have access to all information –
public, private, or protected – within the class.
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What is purpose of inheritance?
What does sksksk mean in text slang?
What is a superclass in oop?
what is the drawback of classical methods in oops?
How is polymorphism achieved?
Can enum be null?
Can we override main method?
Can a destructor be called directly?
What is encapsulation in ict?
What are the benefits of oop?
class type to basic type conversion
What is class and object in oops?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
What is the difference between procedural programming and oops?
Why is it so that we can have virtual constructors but we cannot have virtual destructors?