C++ Containers Question:

Download Job Interview Questions and Answers PDF

Can you please explain the difference between homogeneous and a heterogeneous container?

C++ Containers Interview Question
C++ Containers Interview Question

Answer:

A container is an object holding instances of another object. A container that contains or holds objects of a single type is said to be homogenous. On the other hand, A container that contains objects (derived from a common base class) of a variety of types is termed heterogeneous.

Download C++ Containers Interview Questions And Answers PDF

Previous QuestionNext Question
Do you know what is a container class? What are the types of container classes?Tell me when should we use container classes instead of arrays?