What is friend class?
Page 1 of 1
What is friend class?
In object-oriented programming to allow access to "private" or "protected" data of a class in another class, the latter class is declared as a friend class.
Example
//A friend class can be declared as:
class A
{
private:
//...(statements)
public:
//...(statements)
friend class B;
}
Example
//A friend class can be declared as:
class A
{
private:
//...(statements)
public:
//...(statements)
friend class B;
}
skyboard- Posts : 31
Join date : 2011-09-03
Similar topics
» What does it mean that a method or class is abstract?
» How can we make a class Singleton?
» What is the difference between a struct and a class?
» What methods does Class Object has?
» Difference between Interface and Abstract Class?
» How can we make a class Singleton?
» What is the difference between a struct and a class?
» What methods does Class Object has?
» Difference between Interface and Abstract Class?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum