Programming - C++ Language

You Are Here :: Home > C++ Language > constructor - General Questions

 
7.

Only the address of the object is transferred to the function                        


A. Pass-by-reference B. Pass-by-pointer
C. Pass-by-value D. None of the above




8.

A constructor                        


A. Constructs new data type B. Enables the initialization of an object as it is created
C. Obtain memory for a new variable D. None of the above




9.

Which of the following is called automatically each time an object is created?                        


A. Compiler B. Builder
C. Constructor D. Destructor




10.

Which of the following is called automatically each time an object goes out of scope?                        


A. Compiler B. Builder
C. Constructor D. Destructor




11.

When writing a class, the compiler automatically creates some support functions for the class. What are some of these functions?                        


A. Assignment operator function B. Copy constructor
C. Assignment operator and copy constructor D. None of the Above




12.

Assume you have to write a class that makes use of dynamic memory allocation (the class needs to allocate and de-allocate memory). According to best practices, where would the keyword ‘new’ be placed?                        


A. Classes are smart data types. The compiler takes care of calling new/delete. B. In the constructor
C. In the destructor D. In a separate, dedicated function




« prev

1

2

3

4

5

6

7

8

9

next »

 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on