Other contributors have said "What are Disadvantage in using friend function in c plus plus programming language?" is the same question as "What are Disadvantage of friend function in c plus plus programming language?" If you believe that these are not asking the same thing and should be answered differently, click here

What are Disadvantage of friend function in c plus plus programming language?

Answer:
A friend function can use any of the private data of an object without going thru a mutator or gateway function. As a result, since it can do anything it wants with the private data of an object there is no built-in checking on validity, etc.

But, then again, that is what the friend function is for. An old saying revolving around this is that you need to trust your friends, and your friend better be a 'very good friend' to you (the object class).
First answer by Enigmamerlin. Last edit by Enigmamerlin. Contributor trust: 107 [recommend contributor recommended]. Question popularity: 1 [recommend question].