Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Constructors and Destructors Questions
C++ destructors: how many arguments does a destructor take?
C++ object lifetime for automatic objects: constructors and destructors are called when objects…
C++ destructors: which statement is correct about naming, return type, and overloading?
C++ constructors: which statement is correct about naming, return type, and overloading?
C++ destructors: which statement correctly describes what a destructor destroys?
In C++ (object-oriented programming), can a class declare a virtual destructor? Explain your choice based on polymorphic deletion and best practices.
Constructors vs. destructors in C++: which statement is correct about how they are invoked? Consider implicit calls at scope boundaries and possible explicit use in special cases.
Which statement is correct about C++ destructors and their return type? Choose the precise language rule.
C++ destructors: passing arguments to a destructor is considered which kind of error? Identify the compile-time classification.
Which statements about C++ constructors in inheritance are correct? Consider access to base members and whether constructors are inherited or callable.
Program termination via std::exit or std::abort: what happens to destructors of automatic (stack) objects in C++?
When an object's lifetime ends in C++, which special member function of its class is invoked for cleanup?
Order of destruction in C++: destructor calls occur in what relation to the order of the corresponding constructor calls?
By C++ definition, a “default constructor” is a constructor that accepts how many parameters?
Which statement about C++ constructors is incorrect? Evaluate the claims about compiler-provided constructors and required access level.
C++ constructors: what happens if a class defines only parameterized constructors (no zero-argument/default constructor), but the program attempts to create an object that requires a no-argument constructor?
C++ special members: the function whose name is the class name prefixed with a tilde (~) is called what?
C++ unions: a union without any user-declared constructor can be initialized from another union of which type?
C++ copy constructor design: if the copy constructor takes its parameter by value, what happens?
C++ copy constructor parameter: how must a copy constructor receive its argument for correct behavior?
1
2
3