Data Structure
Java
Python
HTML
Interview Preparation
Interview Prep
Tutorials
Tracks
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.0K+ articles
Python
19.6K+ articles
Experiences
15.8K+ articles
C++
3.7K+ articles
C++ Programs
1.5K+ articles
How To
1.2K+ articles
cpp-class
58+ articles
Friend function and class
2+ articles
C++-friend keyword
1+ articles
cpp-friend
4 posts
Recent Articles
Popular Articles
Mutual friendship of Classes in C++ with Examples
Last Updated: 15 July 2025
Prerequisite: Friend Class in C++A friend class can access private and protected members of other classes in which it is declared as a friend. It is sometimes useful to al...
read more
C++ Programs
C++
How To
Friend function and class
C++-friend keyword
cpp-friend
C++ Program to swap two members using Friend Function
Last Updated: 11 July 2025
Pre-requisite: Friend FunctionCASE 1:Given two numbers a b, swap these two numbers using the friend function of C++.Examples:Input : a = 5, b = 9Output : a = 9, b = 5Inpu...
read more
Technical Scripter
C++ Programs
C++
cpp-friend
Friend Class and Function in C++
Last Updated: 01 October 2025
In C++, friend functions and friend classes are concepts that allow certain functions or classes to access the private and protected members of another class. Friend Class...
read more
C++
cpp-friend
Can We Access Private Data Members of a Class without using a Member or a Friend Function in C++?
Last Updated: 23 July 2025
The idea of Encapsulation is to bundle data and methods (that work on the data) together and restrict access of private data members outside the class. In C++, a friend fu...
read more
C++
cpp-class
cpp-friend