Why c++ does not have finally?



Why c++ does not have finally?..

Answer / Ashis Kumar

C++ does not have a 'finally' block as part of its exception handling mechanism. Instead, it uses RAII (Resource Acquisition Is Initialization) and destructors to ensure that resources are cleaned up properly when exceptions occur.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

How a new element can be added or pushed in a stack?

1 Answers  


Explain about Garbage Collector?

1 Answers  


Given the following seqment of code containing a group of nested if instructions: y = 9; if ((x==3) || (x == 5)) y++; else if (x == 2) y *= 2; else if (x == 4 ) y-= 7; else y = 8; Enter a segment of code (without any IF statements) that does exectly the same thing using the switch structure.

1 Answers  


Difference between delete and free.

1 Answers  


Why isn't sizeof for a struct equal to the sum of sizeof of each member?

1 Answers  


How to write a program such that it will delete itself after exectution?

3 Answers  


What is polymorphism and its type in c++?

1 Answers  


What is the difference between Char a[ ]=”string” and char *a=”String”

11 Answers   Adobe,


Explain the auto storage classes in c++.

1 Answers  


What is public, protected, private in c++?

1 Answers  


How can you find the nodes with repetetive data in a linked list?

1 Answers   Lucent,


What is the purpose of template?

1 Answers  


Categories