Destructor , C/C++ Programming

Assignment Help:

How can I handle a destructor that fails? Need help please provide example also.


Related Discussions:- Destructor

Decodethecode, decode smugglers are very smart in day by day

decode smugglers are very smart in day by day

Structure, Write a function that calculates the number of elapsed days betw...

Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? Becareful for the Leap year

Define polymorphism?, Define Polymorphism? A: Polymorphism let a client ...

Define Polymorphism? A: Polymorphism let a client to treat di_erent objects in the simialr way even if they were developed from di_erent classes and exhibit di_erent behaviors.

Friendly function and rules of friend function, F r i e n dly Function...

F r i e n dly Function: A class can have public members and private members.   The public member can be used through the class using dot operator.   Where as private me

Define some features of external storage class in c program, Define some fe...

Define some features of external storage class in c program? The features of an external storage class variable are as follows: Storage - memory Default initial value -

Advanced features of c, We are now quite happy to use the basic mathematica...

We are now quite happy to use the basic mathematical expressions, however in engineering we use scientific functions i.e Sin , Cos  , ln etc . Within C we have the following functi

Program create a user defined data structure - c++ program, Create a user-d...

Create a user-defined data structure (struct) called Node that represents a node within a linked list where the "data" stored in each node is a pointer to a Car object.    a) Wr

Explain the function of five elements that are on a, explain the function o...

explain the function of five elements that are found on a motherboard#

Statistical and Numerical methods using C++–, An experiment succeeds twice ...

An experiment succeeds twice as often as it fails. Find the chance that in the next six trials there will be at least four successes.

Write a structured and annotated c program, Intelligent homes are becoming ...

Intelligent homes are becoming increasingly popular as the cost/performance ratio of microcontrollers is continuously dropping.  These systems incorporate various transducers to de

Archie

2/13/2013 1:18:53 AM

Write a message to a log-_le. But do not throw an exception. The C++ rule is that you must never throw an exception from a destructor that is being called during the "stack unwinding" process of another exception. For example, if someone says throw Poo(), the stack will be unwound so all the stack frames between the throw Poo() and the } catch (Poo e) { will get popped. This is called stack unwinding. During stack unwinding, all the local objects in all those stack frames are destructed. If one of those destructors throws an exception (say it throws a Bar object), the C++ runtime system is in a no-win situation: should it ignore the Bar and end up in the} catch (Poo e) { where it was originally headed? Should it ignore the Poo and look for a} catch (Bare) {handler? There is no good answer:either choice loses information. So the C++ language guarantees that it will call terminate() at this point, and terminate() kills the process. Bang you''re dead.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd