C++ Programming Questions

Q.  In case of inheritance where both base and derived class are having constructor and destructor, then which if the following are true ? 1. Constructors are executed in their order of derivation 2. Constructors are executed in reverse order of derivation 3. Destructors are executed in their order of derivation 4. Destructors are executed in reverse order of derivation

a. Only 2 ,4
b. Only 1 , 3
c. Only 1 , 4
d. Only 2, 3


ANSWER: See Answer
 
No explanation is available for this question!
MCQs:  Which of the following is not a casting operator in CPP?
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  ___________ header file is used for manipulators.
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  While redefining a virtual function in the derived class, if its prototype is changed then ___________________ .
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  const member function does not allow to modify/alter value of any data member of the class.
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  In a program, If there exists a function template with two parameters and normal function say void add(int , int), so add(3,4) will _____________________ .
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  Can struct be used as Base class for inheritance ?
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  In case of inheritance where both base and derived class are having constructors, when an object of derived class is created then___________ .
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  Which of the following is not a file opening mode ____ .
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  Attempting to throw an exception that is not supported by a function call results in calling _____________ library function.
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  How can we restrict a function to throw certain exceptions?
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  Is it possible to define a constructor with default arguments?
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  The purpose of explicit keyword is to tell the compiler that a certain constructor may not be used to implicitly cast an expression to its class type.
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  Scope resolution operator is used______ .
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  In case of operator overloading, operator function must be ______ . 1. Static member functions 2. Non- static member functions 3. Friend Functions
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  A try block can be nested under another try block.
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  In nested try blocks, there is no need to specify catch handler for inner try block. Outer catch handler is sufficient for the program.
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  We can prevent a function from throwing any exceptions.
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  Functions called from within a try block may also throw exception.
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  The explicit keyword is an optional decoration for the constructors that takes exactly_____argument.
Category: Computer Science MCQs,   Published by: T-Code Scripts
MCQs:  A class can contain objects of other classes and this phenomenon is called_________ .
Category: Computer Science MCQs,   Published by: T-Code Scripts