Home > CompTIA Security+ Certification > Quizzes > Object Oriented Programming Practice Test: Memory Allocation & Scope of Variable
Object Oriented Programming Practice Test: Memory Allocation & Scope of Variable
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 74% Most missed: “If an object is allocated using new operator ____________”
Quiz questions on new and delete operators, automatic and extern variables. In object-oriented programming (OOP), memory allocation is the process of allocating memory to store the data members and functions of an object. The amount of memory required for an object depends on the size and type of its data members and the size and complexity of its member functions. In most programming languages, memory allocation for objects is done automatically when an object is created. When an object is destroyed, the memory allocated to it is automatically deallocated. The scope of a variable in OOP... Show more
Object Oriented Programming Practice Test: Memory Allocation & Scope of Variable
Time left 00:00
25 Questions

1. What does a header file contain for an extern variable?
2. What happens when new fails?
3. Whenever a function is declared in a program _____________________
4. What are automatic variables?
5. If a new operator is defined for a class and still global new operator have to be used, which operator should be used with the keyword new?
6. What is a delete operator?
7. What values does uninitialized automatic variables contain?
8. If extern variable is initialized with the declaration then _______________________
9. What is the new operator?
10. Constructor of automatic variables is called ____________________
11. Which type of value has resulted from the delete operator?
12. In C++, if new operator is used, when is the constructor called?
13. If an automatic variable is created and then a function is called then ________________
14. If the definition is given in the header file that we include then ________________
15. Delete operator _________________
16. Which condition is true if the extern variable is used in a file?
17. Scope of an automatic variable _______________
18. The new operator _____________
19. Which among the following is true for the variables?
20. The new operator _________________
21. Microsoft C++ Components extensions support new keyword to _____________
22. The delete operator __________________________
23. Which cases among the following produces the undefined result?
24. How does compiler convert “::operator new” implicitly?
25. Which among the following is true?