Home > General Studies (Hindi) > Quizzes > C++ Programming Practice Test: Class Hierarchies, Library & Containers in C++
C++ Programming Practice Test: Class Hierarchies, Library & Containers in C++
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 86% Most missed: “To which of the following access specifiers are applicable?”
C++ Quiz on on different aspects of a container which includes creation and design of new containers, vectors and sequences, types of inheritance and various class hierarchies, sequences like seq_con array class, seq_con vector class, stl – pair and heap, vtable, vptr, generators, array type manipulations, tuples, complex library, valarray, bitset and class relationships. Class Hierarchies: A class hierarchy in C++ is a structure where classes are organized in a tree-like manner, with a base class at the top and derived classes below it. The derived classes inherit the properties and methods... Show more
C++ Programming Practice Test: Class Hierarchies, Library & Containers in C++
Time left 00:00
25 Questions

1. Virtual functions in C++ tells the compiler to perform ______________________ on such functions.
2. Which of the following will return the new element at the end of container?
3. Which function is used to check whether a given sequence is heap or not?
4. What is a pair?
5. By using which of the following the elements in the associate container can be efficiently accessed?
6. Which header file is required to use any container?
7. Which of the following is correct syntax of making heap from a vector v?
8. What is the use of fill() function in array class?
9. What is the syntax of declaraing a forward_list?
10. How can object be allocated outside the object lifetime?
11. What is the syntax of swap()?
12. Which function is used to get the total capacity of a vector?
13. What is the use of type() function in any container?
14. What does the checked iterator allow you to find?
15. What is the correct syntax of declaring an array class?
16. Which of the following is correct about bitset and vector of bools?
17. What is the use of header
18. How many types of container classes are there in c++?
19. What does polymorphism in OOPs mean?
20. Elements in STL heap are removed in ________________________
21. What do maps and sets support?
22. What will be the output of the following C++ code?
#include
#include
using namespace std;
int main ()
{
vector myvector;
int sum (0);
myvector.push_back (100);
myvector.push_back (200);
myvector.push_back (300);
while (!myvector.empty())
{
sum += myvector.back();
myvector.pop_back();
}
cout << sum << '\n';
return 0;
}
23. What is sequence container arrays?
24. What will be the output of the following C++ code?
#include
#include
using namespace std;
struct A
{
virtual ~A() { };
void operator delete(void* p)
{
cout << "A :: operator delete" << endl;
}
};
struct B : A
{
void operator delete(void* p)
{
cout << "B :: operator delete" << endl;
}
};
int main()
{
A* ap = new B;
delete ap;
}
25. What is the Run-Time Type Information?