Find jobs | Company-wise jobs
Jobseekers | Employer login
About us Sitemap of www.CareerRide.com Sitemap FAQ related with www.CareerRide.com FAQ Click here to Contact us Contact
       
Submit Resume Free ! | Access Resume Free !
Home Interview Q&A Tutorials .NET Java Soft skills CV GD Work from home IT practice test MBA practice test FAQs in PDF Books Jobs FAQs
Interview questions                  
C++ interview
C interview
C test!
C++ test!
Data structure test!
C++ access control
C++ COM
C++ constructors destructors
C++ containers
C++ DCOM
C++ derived class
C++ error handling
C++ exception handling
C++ friend members
C++ inheritance
C++ inline function
C++ memory leaks
C++ namespaces
C++ new and delete
C++ operator overloading
C++ pointers
C++ references
C++ static data
C++ syntax
C++ template
C++ type checking
C++ virtual functions
C++ pure virtual functions
C++ as an object-oriented
More concept of C++
C++ data types
C++ control constructs
C++ collections
C++ functions
C++ arrays
C++ C-string
C++ classes and structure
C++ Friend functions & classes
C++ polymorphism
C++ multiple inheritance
C++ function template
C++ class templates
C++ standard stream class
ATL server
Data structure in C++
 

C++ Constructors and destructors

What is a constructor?

Constructors allow initialization of objects at the time of their creation. Constructor function is a special function that is a member of the class and has same name as that of the class. An object’s constructor..............

What are destructors?

Destructors are complements of constructors. When an object is destroyed, its destructor is automatically called. Destructors are mainly useful for doing the clean up job. E.g. an object may have..............

What are the restrictions apply to constructors and destructors?

The following restrictions apply to constructors and destructors

Constructors and destructors don't return values.
The addresses of constructors and destructors can't be taken so we can't use references and pointers on them...............

Explain the order in which constructors are called when an object of a derived class is created.

The constructors of any virtual base classes are called first in the order of inheritance...............

What is the difference between a copy constructor and an assignment operator?

A copy constructor is used to declare and initialize an object from another object. ..............

What is a virtual destructor? Explain the use of it.

If the destructor in the base class is not made virtual, then an object that might have been declared of type base class and instance of child class would simply call the base class destructor without calling the derived class destructor...............

How should a contructor handle a failure?

Constructors don't have a return type, so it's not possible to use return codes. The best way to signal..............

What are shallow and deep copy?

A shallow copy just copies the values of the data as they are. Even if there is a pointer that points to dynamically allocated memory, the pointer in the copy will point to the same dynamically allocated..............

What is virtual constructors/destructors?

The explicit destroying of object with the use of delete operator to a base class pointer to the object is performed by the destructor of the base-class is invoked on that object................

More Related Links
More about constructors and destructors
Define access privileges in C++.

Answer - You have access privileges in C++ such as public, protected and private that helps.....

Explain the difference between structures and classes

Answer - Syntactically and functionally, both structures and classes are....

Explain container class and its types in C++.

Answer - A container stores many entities and provide sequential or direct access to them. List, vector and strings are......

 
Want to be hunted by potential employers? Just submit your key skills!

Popular FAQs

.NET .Net Architecture ADO.NET Java Oracle C#.NET
VB.NET DOT.NET AJAX ASP.NET NET Framework OOPS in .NET
C++ Sql Server Data warehousing EJB MySQL Linux
PHP UML Networking Testing XML  
 
Copyright © 2008 - 2010 CareerRide.com. All rights reserved.