Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the use of friend function?

Answer Posted / damodar narayan

Visibility

The visibility of a property or method can be defined by prefixing the declaration with the keywords public, protected or private. Class members declared public can be accessed everywhere. Members declared protected can be accessed only within the class itself and by inherited and parent classes. Members declared as private may only be accessed by the class that defines the member.

The policy is if you are not a member, you can’t get it. But there is a certain situation wherein you need to share your private or protected data with nonmembers. ‘Friends’ come here as a rescue.

A friend function is a non-member function that grants access to class’s private and protected members.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain some of the php array functions?

1118


What is traits? How it is used in php?

1098


Is c similar to php?

970


What is difference between explode() or split() in PHP?

994


Why session is required?

994


How to turn on the session support in php?

1008


What is the method to register a variable into a session?

896


What are the difference between overloading and overriding in oops?

1076


Explain the advantages of using PHP?

1062


How php statement is different from php script?

1035


Which function is used in php to count the total number of rows returned by any query?

1079


What does addslashes do in php?

1114


How stop the execution of a php scrip?

1069


Tell me how to set a page as a home page in a php based site?

995


What are the special characters you need to escape in single-quoted stings?

973