ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
   
 
Categories  >>  Software  >>  Programming Languages  >>  C++  >>  OOPS
 
 


 

 
 STL interview questions  STL Interview Questions
 OOPS interview questions  OOPS Interview Questions
 C++ General interview questions  C++ General Interview Questions
Question
What is a friend function & its advantage?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is a friend function & its advantage?
Answer
# 1
friend function is the one that can access the private data
members of the class to which it is made as friend. this is
advantageous when any class needs any computation which
requires the private data members of two different classes.
in such case that class can be made as friend to both the
classes whose data it needs
 
Is This Answer Correct ?    11 Yes 0 No
Supriya
 
  Re: What is a friend function & its advantage?
Answer
# 2
The above ans is also right.
->Friend function is the one that can access the private
data members of the same class and other class which it is
made as friend.
->The advantageous of friend function that function not called
by object of the class.
->That means without using object name and dot operator that call the friend function.It
can define private area and public area.
->The friend function define outside the class without using
the class name and scope resolution operator.
 
Is This Answer Correct ?    7 Yes 3 No
Devi
 
 
 

 
 
 
Other OOPS Interview Questions
 
  Question Asked @ Answers
 
what is function overloading..?  4
Given two strings like x=?hello? and y=?open?, remove any character from string x which is also used in string y, thus making the result x=?hll?. IBM13
In c++ there is only virtual destructors, no constructors. Why? Polaris4
What is Object and Class? What are the differences between them?  5
what uses of c++ language?  2
swapping program does not use third variable TCS5
which structured data type is not used in c++? 1.union 2.structure 3.string 4.boolean HCL2
Write a program to find out the number of palindromes in a sentence. TCS1
namespace is working on which compiler?  3
What is the difference between class and structure?  7
whats the difference between c and c++ Syntel7
can we make game by using c SmartData1
 
For more OOPS Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2012  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com