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
Describe Processing an array? The Single operations which involve complete arrays are not permitted in C language. therefore if a and b are similar arrays (for example same dim

C Program for FUNCTION OF COPY ONE STRING IN OTHER STRING #include stdio.h> #include conio.h> int copy(char a[],char b[]); void main() {           char a[100],b[

Area under the curve Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve bet

Question 1 Implement a class stack which simulates the operations of the stack allowing LIFO operations. Also implement push and pop operations for the stack 2 Explain the c


What do you mean by a sequential access file? - When writing programs which store and retrieve data in a file, it's possible to designate that file into various forms. - A s

Problem : Change to palindrome A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your ta

Run the following C++ program with and without preprocessor variable POSTFIX defined. #include using namespace std; extern "C" int atoi( const char *str );

The rPeANUt simulator provides buffering of the characters that are typed into the terminal. However, this would generally not be the case so if the program did not consume a chara

Write a program that performs character processing on 10 characters read in from a file, and writes the results to output files. Do NOT use loops or arrays to solve this problem. N