How can I handle a constructor that fails?

Category: C Interview Question, C++ Questions    |    4 views

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

Share/Save/Bookmark

1 Star2 Stars
Loading ... Loading ...

0 responses so far!

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word