A friend in need is a friend indeed means a friend in need is a true friend.
Friendship described with discipline and practiced with immortal faith. True friendship is invaluable and found rarely.
Friendship means exploring beauty of emotions.
Basically, he is trying to correlate the computer world and real world. He is trying to making the base of friend functions through the real life world because he know that our mind holds things in two ways
- Visual ways(through pictures).
- Base(in Hindi – neev)
He likes C++ language a lot not because he has adapted it’s power or rules rather it is the first programming language he learnt.
He distinctly remember the circumstances leading to this delicious learning journey.
Ohh No, the new semester is going to be start and half book is yet to be read.
The above talk was his past but now again he has keen power to explore beauty of C++
So, below I’ll write the summary of it as you know the motive of writing this blog.
“Computer programming is nothing but a simulation(representation to computer program) of the human mind, experiences, challenges and goals”.
Friends in C++:
A class contains all types of data i.e. public, private, protected. Analogy, there are things that man can share publicly, private(with family members and friends).
To know the secrets of a man be a family member is not so easy and always but being a friend is much easy. Isn’t it?
Just re-declare that function inside the class body (you must not re-define it, that’d be a syntax error) and use the keyword “friend” in this declaration. The re-declaration must be in the public section of the class definition.
Friend function can access the private and protected data of the class through the objects.
- Friendship is not implicitly reciprocated. If class A is a friend to class B then the inverse is not true. That would need an explicit desire from the programmer.2. A derived class does not inherit the friendship of its parents. If your parents are friends with someone, then that does not mean you should be friends with them too, does it?
- A friend function (or class) cannot be extern. This means that friend functions need to be defined in the same file as their friend class. You cannot declare a function defined in some other file as the friend of a class. Vicinity is a necessity for friendship.
- A friend function must not be static because static function are used without objects(contradicts the point of accessing data of class through objects).
Hope I was able to make you clear th objective of his blog.