What do you know about friend class and friend function?

Answer Posted / hrpynux@gmail.com

A friend function is a function that is specified outside a class but has the ability to access the class members' protected and private data. A friend can be a member's function, function template, or function, or a class or class template, in which case the entire class and all of its members are friends.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is scope operator in c++?

567


Why is it necessary to use a reference in the argument to the copy constructor?

637


what is pre-processor in C++?

599


When does a 'this' pointer get created?

624


How we can differentiate between a pre and post increment operators during overloading?

600






Does c++ have string data type?

695


Which function cannot be overloaded c++?

581


Can we make any program in c++ without using any header file and what is the shortest program in c++.

617


What is size of string in c++?

558


What is the this pointer?

637


Write a program in C++ for Fibonacci series

664


What is the difference between reference and pointer?

614


Write about the various sections of the executable image?

577


What is the type of 'this' pointer?

605


What is polymorphism and its type in c++?

594