answersLogoWhite

0


Best Answer

There is no such thing. When declaring a friend function only the explicitly-scoped friend is granted private access. The friend function may well be declared virtual within its own class but none of its overrides are granted access unless they are explicitly granted access.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

A virtual function is a base class function that can be overridden by a derived class.

A friend function is a non-member function that has private access to the class representation.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Everything: they are absolutely unrelated.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between friend function and inheritance in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between constructor and friend function in c plus plus?

A constructor is a method that fires when the object is instantiated. A friend function is a function that has special access to the object. They are two different types of things, and cannot be further differenced.


Why java does not support friend function?

One of the main goals kept in mind while Java was being developed was that they wanted it to be like C++, but without all the features which make the language overly complex and messy. These features include things like (true) multiple inheritance, operator overloading, and friend functions.


How do you differentiate between a member function and normal function?

A normal function is any function that is not a member of any class. Normal functions that operate upon a class are referred to as non-member functions, however a non-member function can also be a member of another class. Any class may declare any non-member function to be a friend of the class, in which case the function becomes a friend function.A member function is a member of a class and may be declared static or non-static. Non-static member functions have the following 3 properties:Private access to the class members.Scoped to the class.Must be invoked against an object of the class (has a 'this' pointer).Static member functions have the first two properties only while friend functions have the first property only. Non-member functions that are not friends of the class have none of these properties.


What is the latent function of friends?

The only function of a friend is to extend the private class interface outwith the class, essentially making the friend part of the class interface.


Why a friend function cannot be used to overload the assignment operator?

Assignment(=) operator is a special operator that will be provided by the constructor to the class when programmer has not provided(overloaded) as member of the class.(like copy constructor). When programmer is overloading = operator using friend function, two = operations will exists: 1) compiler is providing = operator 2) programmer is providing(overloading) = operator by friend function. Then simply ambiguity will be created and compiler will gives error. Its compilation error.

Related questions

What is the difference between friend function and normal member function?

We can access a Friend function from any other class in which friend function is introduced or declared even if the other class is not a member of first class. But when we use normal member function, we can have its access only in the derived classes of the first class. This is the basic difference between a friend function and a normal member function.


What is the difference between constructor and friend function in c plus plus?

A constructor is a method that fires when the object is instantiated. A friend function is a function that has special access to the object. They are two different types of things, and cannot be further differenced.


What is the difference between boy friend best friend?

they both ur homies


What is the meaning difference between the words girlfriend and girl friend?

girl friend is a friend that is girl and not a best friend and girl friend is best friend


What is the difference between a fan and a friend on Facebook?

if you are a friend you can look at their profile. if you are a fan... i dont know


What is the difference between close friend and best friend?

a close friend is someone you can talk to, and do things with. A best friend is someone you can tell anything to.


What is the difference between strangers and friends?

A friend is a family member that you have chosen and a stranger is a friend that you have not met yet.


What is the difference between friend with courage and a friend of the court?

Friends are friends. But friends have different qualities, you know which friend to turn to at what point.


How do you tell the difference between friends and lovers?

How they introduce them. Friend: "This is my friend, so and so" Lover: "This is my, um, friend, so and so"


How do you tell the difference between a friend and love hug?

Youll know.


What is the difference between be and become?

He come back.He become my friend now .


What is the difference between a female friend and a male friend?

"boys have penises, girls have vaginas" -- The kid from kindergarten cop