We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,420 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

merits & demerits of friend functions

can anyone tell me the merits & demerits of friend functions?
p.s. help me
kushal

8
Contributors
9
Replies
4 Years
Discussion Span
3 Years Ago
Last Updated
10
Views
Kushal Thakkar
Newbie Poster
4 posts since Feb 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

the only time i can think of using friend functions is for operator overloading.. the rest of the time they should be avoided because they violate OOP data encapsulation.

Clinton Portis
Practically a Posting Shark
833 posts since Oct 2005
Reputation Points: 237
Solved Threads: 119
Skill Endorsements: 5

>the rest of the time they should be avoided because they violate OOP data encapsulation.
If this is what you think, then you're not in a position to help. Those who still need to learn shouldn't be teaching.

Narue
Bad Cop
Team Colleague
15,460 posts since Sep 2004
Reputation Points: 6,483
Solved Threads: 1,407
Skill Endorsements: 54

Both the OP and the 1st reply could benefit from this link
http://www.parashift.com/c++-faq-lite/friends.html

Bench
Posting Pro
577 posts since Feb 2006
Reputation Points: 307
Solved Threads: 63
Skill Endorsements: 0
SpS
Posting Pro
599 posts since Aug 2005
Reputation Points: 70
Solved Threads: 32
Skill Endorsements: 0

thanxs sunnypalsingh, it was a great help...

Kushal Thakkar
Newbie Poster
4 posts since Feb 2006
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

what r merits & demerits of friend function

supriya kalekar
Newbie Poster
1 post since Nov 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

please tell me merits and demerits of friend function

himanshu shekha
Newbie Poster
1 post since Mar 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Uh. Follow the links posted already in the thread? (Try not to be an unthinking idiot who is not inclined to read the replies already posted here.)

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Skill Endorsements: 38

Uh. Follow the links posted already in the thread? (Try not to be an unthinking idiot who is not inclined to read the replies already posted here.)

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Skill Endorsements: 38

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0816 seconds using 2.74MB