What is the difference between public, private, protected
inheritance?

Answer Posted / saikat

A private member can only be accessed by other methods of
the same class, while a public member can be accessed by
methods of any class or by non class code.

Is This Answer Correct ?    9 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c++ iterator?

835


What is diamond problem in c++?

767


What are all predefined data types in c++?

786


How would you obtain segment and offset addresses from a far address of a memory location?

829


How much maximum can you allocate in a single call to malloc()?

862


Explain the difference between using macro and inline functions?

809


Does c++ support multilevel and multiple inheritances?

746


What is the use of class in c++?

780


I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.

823


How can we access protected and private members of a class?

843


Can we specify variable field width in a scanf() format string? If possible how?

904


what are the iterator and generic algorithms.

1722


What is the type of this pointer in c++?

818


What is tellg () in c++?

1011


what is Loop function? What are different types of Loops?

896