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
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

c program for boardcolouring

Write a program to find minimum number of shelves

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

A body which has three forces acting on it is in equilibrium. One force is 3N to the North and the other is 4N to the west. What us the magnitude and direction of the third force?

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

write a program that can accept numbers and perform all the four arithmetic operation


A: Use a member while you can and a friend when you need to. Sometimes friends are better syntactically (e.g., in class Fred, friend functions let the Fred parameter to be secon

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send