If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?



If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?..

Answer / Rajvir Kumar

No, terrier is not a friend of boy by default. Friendship is not inherited in C++. You would need to explicitly make Terrier a friend of Boy if you wanted that relationship.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Describe linkages and types of linkages?

1 Answers  


What are the benefits of operator overloading?

1 Answers  


Explain the auto storage classes in c++.

1 Answers  


1.Between 100 and 999 are some numbers that have the characteristics that if you cube the individual digits and sum together you will get the same number. 2. A program that can accept as input an integer and output the equivalent of that number in words.

3 Answers  


What's the order in which the local objects are destructed?

1 Answers  


What do you mean by const correctness?

1 Answers  


What is virtual base class?

1 Answers  


What are advantages of using friend classes?

1 Answers  


What are virtual constructors/destructors?

1 Answers  


What is a local variable?

1 Answers  


What is a dll entry point?

1 Answers  


What is the difference between a shallow copy and a deep copy?

3 Answers  


Categories