Interviewer And Interviewee Guide

C++ Constructors Interview Question:

Tell me how should a constructor handle a failure?

Submitted by: Administrator
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.
Submitted by: Administrator

Read Online C++ Constructors Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.