What happens if an exception is throws from an, object's
constructor and object's destructor?
Answer Posted / som shekhar
When an exception is thrown from the object constructor,
then the destructor of the object wont be called. But to
undone all the things that happened in the c'tor before the
exception is thrown, you can make use of smart
pointer(either boost smart pointer or std auto pointer).
when an exception is thrown from the destructor the compiler
terminates the application.
So it is advisable not to throw an exception in the
destructor , better to do "something else".
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the default access level?
Is C++ case sensitive a) False b) Depends on implementation c) True
Are there interfaces in c++?
What do you mean by translation unit?
What is an undefined behavior and sequence points
Write about the stack unwinding?
Explain the extern storage classes in c++.
Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02
What do you know about near, far and huge pointer?
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
Differentiate between late binding and early binding. What are the advantages of early binding?
What is function overriding in c++?
What are c++ redistributables?
What is #include c++?