What is the difference between friend function and virtual function?

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.