Constructor , C/C++ Programming

How can I handle a constructor that fails?

Posted Date: 2/13/2013 1:12:29 AM | Location : United States





The answer of your problem is

Throw an exception. Constructors don''t have a return type, so it''s not probable to make use of return codes. The best way to signal constructor failure is therefore to throw an exception.

Posted by John | Posted Date: 2/13/2013 1:14:39 AM


Related Discussions:- Constructor , Assignment Help, Ask Question on Constructor , Get Answer, Expert's Help, Constructor Discussions

Write discussion on Constructor
Your posts are moderated
Related Questions
Derived Data Type: Array is derived data type to store large collection of data of only one data type. int mark[100]; char names[25]; Function: will be discussed early


Specifying a Class: As discussed a class is defined to develop an algorithm and bind it together in a core shell. A class is an abstract data type (ADT).  The binding of dat

Destructor: The purpose of destructor is to free the memory when the compiler memory is reduced or not enough to execute certain program. Sometimes there may several objects op

HOW THE C PROGRAM CODING IMPLEMENTED DY ITSELF UNDERSTANDING . ALSO HOW I CAN A BECOME A GOOD PROGRAMMER IN C WHAT I DO FOR GOOD PROGRAMMING ,TELL ME HOW C CODING DEVELOP DY ITSELF

We have used logic symbols in the past, but not really though about the actual real devices. Semiconductor companies have taken the logic symbols are manufactured them into logic f

# c pragram TO count the number of occurances of the string in nth padovan''s string program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : pa

Is it legal for a member function to say delete this? A: As long as you're cautious, it's OK for an object to delete this. Here's how I define "cautious": You have to be a

Consider text comprised of sentences and sentences comprised of words. Words in a sentence will be space delimited. Given a text and K strings, task is to find out the number valid