Example of Friend function cannot be invoked with the object – C++

By: Prof. Dr. Fazal Rehman | Last updated: February 3, 2024

The friend function cannot be invoked with the object as the friend function is not in the scope of that class.

friend function cannot be invoked using the object as it is not in the scope of that class
a friend function cannot be invoked using the object as it is not in the scope of that class

The program shows an error because the Friend function cannot be invoked with the object.

Correct program

 

All Copyrights Reserved 2025 Reserved by T4Tutorials