How can one handle a constructor that fails?, C/C++ Programming

How can one handle a constructor that fails?

Posted Date: 3/15/2013 5:15:55 AM | Location : United States





Q: How can one handle a constructor that fails?

A: Though throwing an exception. Constructors don''t contain a return type, so it''s not achievable to use return codes. The finest way to signal constructor failure is thus to throw an exception 

 

Posted by | Posted Date: 3/15/2013 5:16:18 AM


Related Discussions:- How can one handle a constructor that fails?, Assignment Help, Ask Question on How can one handle a constructor that fails?, Get Answer, Expert's Help, How can one handle a constructor that fails? Discussions

Write discussion on How can one handle a constructor that fails?
Your posts are moderated
Related Questions
Operators The variables, which are declared and explained, are the operands, which are operated upon by the operators. Operators specify what operations are to be performed on

application problem of tower of hanoi

Suppose we use Lists to represent a movie which has a title, cast and year. For example, the following list represents the movie, "Die Hardly", with the cast "Bruce Willing" and "T

Friend function in c++: class miles; class km  {    float value;    public :   // void input();     km convert(km  ,int a ) ;    void output()    {

Stage One Define the specification of the program            Add two nxm size matrices   Stage Two Divide the program up into separate modules           Input Matrix         Ad

What is the difference among a copy constructor and an overloaded assignment operator? Ans) A copy constructor constructs a latest object by using the content of the argument

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concate

People sometimes give their phone numbers using one or more alphabetic characters. Create a program that converts the alphabetic characters to their corresponding numbers. For exam

define a class for student

Need help finishing my homework. It''s been 5 years since I''ve use C++. I am a VN.Net programmer. -Todd