FRND

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

A friend function is a function that isn't a member of a class but has access

to the class's private and protected members.

Not Member of Class: Friend functions are not members of the class they are
declared as friends of.
Access to Private Members: Friend functions have access to the private and
protected members of the class they are declared as friends of.
Declared with friend Keyword: Friend functions are declared using the
friend keyword inside the class definition.
Global Scope: Although declared inside the class, friend functions are not part
of the class's scope; they are defined in the global scope

Copy constructor (C++) In the C++ programming language, a copy constructor


is a special constructor for creating a new object as a copy of an existing object.

You might also like