How is exception handling carried out in c++?
Answers were Sorted based on User's Feedback
Answer / rajesh manem
Using try and Catch blocks the exceptions are handling C++.
We can write our own defined class and we can handle the
exception.Using throw it will throw the exception t the
calling method/class. The throws keyword is used to tell
this method may throw these type of exceptions.We can throw
any exception what ever you like including class objects.
| Is This Answer Correct ? | 10 Yes | 1 No |
Answer / debika mohapatra
EXCEPTION handling was not part of the origin c++.it is a
new feature added to ANSI c++.today,almost all compilers
support this feature.
| Is This Answer Correct ? | 7 Yes | 5 No |
Answer / achal ubbott
Exception handling is not a must of programming. But it is
a cleaner way of getting signal if something goes wrong in
the code. Prior to exceptions people used return values of
functions for reporting errors to application using the
classes inside libraries. The application would call some
function(defined inside class) from within try bock. Now if
something goes wrong then the function(defined inside the
class) would throw an exception. This exception is then
handled by catch block in the application.
| Is This Answer Correct ? | 0 Yes | 0 No |
the difference between new and malloc
difference between abstraction and encapsulation with progarammatic eg. hi,just recently i went for an interview .The interviewer asked what is the difference between abstraction and encapsulation with programmatic eg. I gave the answer as encapsulation mean hiding the relevant data which is not useful for the user, eg a electric fan .hiding the information how the electricity is converted into machanical energy. abtraction showing only the relevant data to the user eg electric fan. it look ,its color ,it design etc only relevant data. Then the interviewer asked me, give me some programmic eg .I Said Let assume a web form having control like textbox,button etc. The user can view textbox,button etc this is the eg of abstraction and when the user click on the button how he is redirected is not known by the user is the eg of the encapsulation. Am I Correct .was the answer given by me is perfect .now i am planing to go for an another interview should i give the same answer.IF not please suggest me a better answer.with some good eg Please help
What is public, protected, private?
Is react oop?
How do you define social class?
Difference ways of Polymorphism?
When you define a integer it gets stored in which data structure?(Stack or a heap)
If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?
Templates mean
What is overloading in oop?
What is a friend function & its advantage?
what are the characteristics of oops?