SlideShare a Scribd company logo
Oct 04, 2007 Handling Exceptions in C++ Dr. Partha Pratim Das Interra Systems (India) Pvt. Ltd.   PART A
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
PART A
Exception Fundamentals Basic Notions
An exceptional circumstance is not necessarily an error   ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
I had thought through the design, but … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
My program was correct, well tested, but for … ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
I managed to put the system out of gear … ,[object Object],[object Object]
Do I need Exception Handling? ,[object Object],[object Object],[object Object],“ Exceptions are C++s means of separating  error reporting  from  error handling ”– Bjarne Stroustrup
The Classical Dilemma ,[object Object],[object Object]
Types of Exceptions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Stages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Stages ,[object Object],[object Object],[object Object],[object Object]
Exception Stages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Stages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C A Recap of Error Handling Techniques
Support for Exceptions in C ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Language Features ,[object Object],[object Object]
Exceptions in C :  Return Value & Parameters  ,[object Object],[object Object],[object Object],[object Object],if ((p = malloc(n)) == NULL) /* ... */ if ((c = getchar()) == EOF) /* ... */ if (A *p = dynamic_cast<A*>(pObj)) /* ... */ else /* ... */
Exceptions in C :  Return Value & Parameters  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Return Value & Parameters  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Return Value & Parameters  ,[object Object],int Push(int i) { if (top_ == size-1) // Incidence return 0; // Raise else stack_[++top_] = i; return 1; } int main() { int x; // ... if (!Push(x)) // Detect { // Handling } // Recovery }
Exceptions in C :  Return Value & Parameters  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Return Value & Parameters  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Return Value & Parameters  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Local goto  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Local goto  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Local goto  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Local goto  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Local goto  _PHNDLR __cdecl signal(int signum, _PHNDLR sigact) { // Lifted from VC98RTRCINSIG.C ...  /* Check for sigact support */ if ( (sigact == ...) )  goto  sigreterror; /* Not exceptions in the host OS. */ if ( (signum == ... ) { ...  goto  sigreterror; }  else { ...  goto  sigretok; } /* Exceptions in the host OS. */ if ( (signum ...) )  goto  sigreterror; ... sigretok: return(oldsigact); sigreterror: errno = EINVAL; return(SIG_ERR); }
Exceptions in C :  Standard Library ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Global Variables  ,[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Global Variables  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Global Variables  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Global Variables  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Global Variables  ,[object Object]
Exceptions in C : Global Variables  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Abnormal Termination  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Abnormal Termination  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Abnormal Termination ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Abnormal Termination  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Abnormal Termination  ,[object Object]
Exceptions in C :  Conditional Termination  ,[object Object],[object Object],[object Object],[object Object]
Exceptions in C :  Conditional Termination  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C :   Conditional Termination  ,[object Object],#if defined NDEBUG #define ASSERT(condition) ((void) 0) #else #define ASSERT(condition) _assert((condition), #condition, __FILE__, __LINE__) #endif
Exceptions in C :  Conditional Termination  ,[object Object]
Exceptions in C :  Conditional Termination  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],#if defined NDEBUG #define VERIFY(condition) (condition) /* Survives */ #else #define VERIFY(condition) _assert((condition), #condition, __FILE__, __LINE__) #endif
Exceptions in C : Non-Local goto  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Non-Local goto ,[object Object],void f() { A a; if (setjmp(jbuf) == 0) { B b; g(); h(); } else { cout <<  ex.what(); } return; } ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Non-Local goto  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Non-Local goto  ,[object Object]
Exceptions in C : Non-Local goto  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Non-Local goto  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Non-Local goto  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Non-Local goto  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Signals  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Typical Signals ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Typical Signals ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Signals  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Signals  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Signals  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Shortcomings  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C : Shortcomings  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SEH in Microsoft-C Standard Exception Handling – A Precursor to Exception Handling in C++
SEH in VC++ ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SEH in VC++ ,[object Object],__try { ... } __except( filter-expression  ) { ... } __try { ... } __finally { ... } __try { ... __leave; ... }
SEH in VC++ ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C++ Basic Notions
Exceptions in C++ : Expectations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C++ : Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C++ : try–catch–throw  ,[object Object],void f() { A a; try { B b; g(); h(); } catch (UsrExcp& ex) { cout <<  ex.what(); } return; } ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
try Block : Scope ,[object Object],[object Object],[object Object],[object Object],void f()  try {  throw E(&quot;Exception thrown in f()&quot;);  } catch (E& e) {  cout << e.error << endl;  }
try Block : Nested try Block ,[object Object],[object Object],try {  func1();  try {  func2();  } catch (spec_err) {  /* ... */  } func3();  } catch (type_err) {  /* ... */  }
catch Block : Arguments ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
catch Block : Matching throw-catch ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
catch Block : Matching throw-catch ,[object Object],[object Object],[object Object],[object Object],[object Object]
catch Block : Order of Catch ,[object Object],[object Object],[object Object],[object Object],[object Object]
catch Block : Order of Match ,[object Object],[object Object],[object Object]
throw  Expression : Semantics ,[object Object],[object Object],[object Object],[object Object]
throw  Expression : Semantics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
(re)  throw : Semantics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
throw  Expression : Semantics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Incomplete Type ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Incomplete Type ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C++ :  Exception Lifetime  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C++ :  Exception Lifetime  ,[object Object],[object Object],[object Object],[object Object]
Exceptions in C++ :  Exception Lifetime  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C++ : Advantages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exceptions in C++ : Advantages ,[object Object],[object Object],[object Object],[object Object]
Exceptions in C++ : Advantages ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Specifications in C++ Notions
Exception Specification : Notion ,[object Object],[object Object],[object Object]
Exception Specification : Rules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Specification : Rules ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Specification : Details ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Specification : Examples ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Specification : Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Will Violate
Exception Specification : Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Will Violate
Exception Specification :  Violation Handling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Specification :  Violation Handling ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Specification : Polymorphism Restrictions ,[object Object],class A { public: virtual void f()  throw(int, char) ; };  class B : public A { public: void f()  throw(int)  { } };  /* The following is not allowed.  class C : public A { public: void f()   throw(...)  { } };  class D : public A {  public: void f()  throw(int, char, double)  { }  };  */
Exception Specification :  Function Pointer Restrictions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Specification :  Union of Specification ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],// Special functions  // Implicitly declared   // Implicitly specified   C::C() throw (int, char);  C::C(const C&);  C::~C() throw();
Exception Specification :  Compiler Support ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Specification :  Compiler Workaround is equivalent to void SomeFunction() throw (E1, E2) { ... }  void SomeFunction() try { ... } catch (E1) { throw; } catch (E2) { throw; } catch (...) { std::unexpected(); }
Standard Exceptions in C++ Classes, Types and Functions
Standard C++ Exception-Object Types
Standard Exceptions : Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Standard Exceptions : Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Standard Exceptions : Classes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Standard Exceptions : Headers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Standard Exceptions : Headers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Standard Exceptions : Types ,[object Object],[object Object],[object Object],[object Object]
Standard Exceptions : Functions ,[object Object],[object Object],[object Object],[object Object],[object Object]
Standard Exceptions : Functions ,[object Object],[object Object]
Standard Exceptions : Functions ,[object Object],[object Object],[object Object],[object Object]
Standard Exceptions : Headers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Handling Exceptions in  C & C++ References & Credits
References ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Credits / Acknowledgements
Thank You

More Related Content

What's hot

Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handlingAlpesh Oza
 
EXCEPTION HANDLING in C++
EXCEPTION HANDLING in C++EXCEPTION HANDLING in C++
EXCEPTION HANDLING in C++
Prof Ansari
 
Exception handling
Exception handlingException handling
Exception handling
Prafull Johri
 
Exception handling in c++ by manoj vasava
Exception handling in c++ by manoj vasavaException handling in c++ by manoj vasava
Exception handling in c++ by manoj vasava
Manoj_vasava
 
Exception Handling in C++
Exception Handling in C++Exception Handling in C++
Exception Handling in C++
Deepak Tathe
 
Exceptions in c++
Exceptions in c++Exceptions in c++
Exceptions in c++
Kuntal Bhowmick
 
Exception handling
Exception handlingException handling
Exception handling
pooja kumari
 
Exception handler
Exception handler Exception handler
Exception handler dishni
 
Unit iii
Unit iiiUnit iii
Unit iii
snehaarao19
 
Exception handling
Exception handlingException handling
Exception handling
Abhishek Pachisia
 
14 exception handling
14 exception handling14 exception handling
14 exception handlingjigeno
 
Exception handling
Exception handlingException handling
Exception handlingIblesoft
 
Exception handling
Exception handlingException handling
Exception handlingRavi Sharda
 
Exception handling c++
Exception handling c++Exception handling c++
Exception handling c++
Jayant Dalvi
 
Exception handling
Exception handlingException handling
Exception handling
Pranali Chaudhari
 
C# Exceptions Handling
C# Exceptions Handling C# Exceptions Handling
C# Exceptions Handling
sharqiyem
 
Exception Handling in object oriented programming using C++
Exception Handling in object oriented programming using C++Exception Handling in object oriented programming using C++
Exception Handling in object oriented programming using C++
Janki Shah
 
Exception handling in c++
Exception handling in c++Exception handling in c++
Exception handling in c++
imran khan
 
CodeChecker summary 21062021
CodeChecker summary 21062021CodeChecker summary 21062021
CodeChecker summary 21062021
Olivera Milenkovic
 
Exception Handling
Exception HandlingException Handling
Exception Handling
Reddhi Basu
 

What's hot (20)

Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handling
 
EXCEPTION HANDLING in C++
EXCEPTION HANDLING in C++EXCEPTION HANDLING in C++
EXCEPTION HANDLING in C++
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling in c++ by manoj vasava
Exception handling in c++ by manoj vasavaException handling in c++ by manoj vasava
Exception handling in c++ by manoj vasava
 
Exception Handling in C++
Exception Handling in C++Exception Handling in C++
Exception Handling in C++
 
Exceptions in c++
Exceptions in c++Exceptions in c++
Exceptions in c++
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handler
Exception handler Exception handler
Exception handler
 
Unit iii
Unit iiiUnit iii
Unit iii
 
Exception handling
Exception handlingException handling
Exception handling
 
14 exception handling
14 exception handling14 exception handling
14 exception handling
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling c++
Exception handling c++Exception handling c++
Exception handling c++
 
Exception handling
Exception handlingException handling
Exception handling
 
C# Exceptions Handling
C# Exceptions Handling C# Exceptions Handling
C# Exceptions Handling
 
Exception Handling in object oriented programming using C++
Exception Handling in object oriented programming using C++Exception Handling in object oriented programming using C++
Exception Handling in object oriented programming using C++
 
Exception handling in c++
Exception handling in c++Exception handling in c++
Exception handling in c++
 
CodeChecker summary 21062021
CodeChecker summary 21062021CodeChecker summary 21062021
CodeChecker summary 21062021
 
Exception Handling
Exception HandlingException Handling
Exception Handling
 

Viewers also liked

Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
Multi-touch Interface for Controlling Multiple Mobile Robots
Multi-touch Interface for Controlling Multiple Mobile RobotsMulti-touch Interface for Controlling Multiple Mobile Robots
Multi-touch Interface for Controlling Multiple Mobile Robots
Jun Kato
 
Giáo trình lập trình GDI+
Giáo trình lập trình GDI+Giáo trình lập trình GDI+
Giáo trình lập trình GDI+
Sự Phạm Thành
 
String in programming language in c or c++
 String in programming language  in c or c++  String in programming language  in c or c++
String in programming language in c or c++
Samsil Arefin
 
String Handling in c++
String Handling in c++String Handling in c++
String Handling in c++Fahim Adil
 
Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1
Ali Aminian
 
SDL Vision for Digital Experience - Arjen van den Akker at SDL Connect 16
SDL Vision for Digital Experience - Arjen van den Akker at SDL Connect 16SDL Vision for Digital Experience - Arjen van den Akker at SDL Connect 16
SDL Vision for Digital Experience - Arjen van den Akker at SDL Connect 16
SDL
 
Strings
StringsStrings
Strings
Nilesh Dalvi
 
Bitmap and Vector Images: Make Sure You Know the Differences
Bitmap and Vector Images: Make Sure You Know the DifferencesBitmap and Vector Images: Make Sure You Know the Differences
Bitmap and Vector Images: Make Sure You Know the Differences
Davina and Caroline
 
VC++ Fundamentals
VC++ FundamentalsVC++ Fundamentals
VC++ Fundamentalsranigiyer
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)
Peter R. Egli
 

Viewers also liked (17)

Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaion
 
05 c++-strings
05 c++-strings05 c++-strings
05 c++-strings
 
Multi-touch Interface for Controlling Multiple Mobile Robots
Multi-touch Interface for Controlling Multiple Mobile RobotsMulti-touch Interface for Controlling Multiple Mobile Robots
Multi-touch Interface for Controlling Multiple Mobile Robots
 
Giáo trình lập trình GDI+
Giáo trình lập trình GDI+Giáo trình lập trình GDI+
Giáo trình lập trình GDI+
 
String in programming language in c or c++
 String in programming language  in c or c++  String in programming language  in c or c++
String in programming language in c or c++
 
Chapter 14
Chapter 14Chapter 14
Chapter 14
 
Vc++ 3
Vc++ 3Vc++ 3
Vc++ 3
 
String Handling in c++
String Handling in c++String Handling in c++
String Handling in c++
 
Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1
 
COM
COMCOM
COM
 
SDL Vision for Digital Experience - Arjen van den Akker at SDL Connect 16
SDL Vision for Digital Experience - Arjen van den Akker at SDL Connect 16SDL Vision for Digital Experience - Arjen van den Akker at SDL Connect 16
SDL Vision for Digital Experience - Arjen van den Akker at SDL Connect 16
 
Active x control
Active x controlActive x control
Active x control
 
Sdi & mdi
Sdi & mdiSdi & mdi
Sdi & mdi
 
Strings
StringsStrings
Strings
 
Bitmap and Vector Images: Make Sure You Know the Differences
Bitmap and Vector Images: Make Sure You Know the DifferencesBitmap and Vector Images: Make Sure You Know the Differences
Bitmap and Vector Images: Make Sure You Know the Differences
 
VC++ Fundamentals
VC++ FundamentalsVC++ Fundamentals
VC++ Fundamentals
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)
 

Similar to Handling Exceptions In C &amp; C++[Part A]

Java Exception Handling, Assertions and Logging
Java Exception Handling, Assertions and LoggingJava Exception Handling, Assertions and Logging
Java Exception Handling, Assertions and Logging
Riccardo Cardin
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handlingAlpesh Oza
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handling
Alpesh Oza
 
Exception handling
Exception handlingException handling
Exception handling
Karthik Sekar
 
Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage" Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage"
Rapita Systems Ltd
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
Vivek chan
 
WINSEM2016-17_CSE1002_LO_1336_24-JAN-2017_RM003_session 10.pptx
WINSEM2016-17_CSE1002_LO_1336_24-JAN-2017_RM003_session 10.pptxWINSEM2016-17_CSE1002_LO_1336_24-JAN-2017_RM003_session 10.pptx
WINSEM2016-17_CSE1002_LO_1336_24-JAN-2017_RM003_session 10.pptx
ssusercd11c4
 
A exception ekon16
A exception ekon16A exception ekon16
A exception ekon16
Max Kleiner
 
UNIT III (2).ppt
UNIT III (2).pptUNIT III (2).ppt
UNIT III (2).ppt
VGaneshKarthikeyan
 
UNIT III.ppt
UNIT III.pptUNIT III.ppt
UNIT III.ppt
Ajit Mali
 
Vc++ 4(exception handling)
Vc++ 4(exception handling)Vc++ 4(exception handling)
Vc++ 4(exception handling)Raman Rv
 
Exception handling
Exception handlingException handling
Exception handling
Raja Sekhar
 
Exceptions in Java
Exceptions in JavaExceptions in Java
Exceptions in JavaVadym Lotar
 
Itp 120 Chapt 18 2009 Exceptions & Assertions
Itp 120 Chapt 18 2009 Exceptions & AssertionsItp 120 Chapt 18 2009 Exceptions & Assertions
Itp 120 Chapt 18 2009 Exceptions & Assertionsphanleson
 
Exception handling
Exception handlingException handling
Exception handling
zindadili
 
JP ASSIGNMENT SERIES PPT.ppt
JP ASSIGNMENT SERIES PPT.pptJP ASSIGNMENT SERIES PPT.ppt
JP ASSIGNMENT SERIES PPT.ppt
JAYAPRIYAR7
 
Exceptions overview
Exceptions overviewExceptions overview
Exceptions overview
Bharath K
 
Advantages Over Conventional Error Handling in OOP
Advantages Over Conventional Error Handling in OOPAdvantages Over Conventional Error Handling in OOP
Advantages Over Conventional Error Handling in OOPRaju Dawadi
 

Similar to Handling Exceptions In C &amp; C++[Part A] (20)

$Cash
$Cash$Cash
$Cash
 
$Cash
$Cash$Cash
$Cash
 
Java Exception Handling, Assertions and Logging
Java Exception Handling, Assertions and LoggingJava Exception Handling, Assertions and Logging
Java Exception Handling, Assertions and Logging
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handling
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handling
 
Exception handling
Exception handlingException handling
Exception handling
 
Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage" Presentation slides: "How to get 100% code coverage"
Presentation slides: "How to get 100% code coverage"
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
 
WINSEM2016-17_CSE1002_LO_1336_24-JAN-2017_RM003_session 10.pptx
WINSEM2016-17_CSE1002_LO_1336_24-JAN-2017_RM003_session 10.pptxWINSEM2016-17_CSE1002_LO_1336_24-JAN-2017_RM003_session 10.pptx
WINSEM2016-17_CSE1002_LO_1336_24-JAN-2017_RM003_session 10.pptx
 
A exception ekon16
A exception ekon16A exception ekon16
A exception ekon16
 
UNIT III (2).ppt
UNIT III (2).pptUNIT III (2).ppt
UNIT III (2).ppt
 
UNIT III.ppt
UNIT III.pptUNIT III.ppt
UNIT III.ppt
 
Vc++ 4(exception handling)
Vc++ 4(exception handling)Vc++ 4(exception handling)
Vc++ 4(exception handling)
 
Exception handling
Exception handlingException handling
Exception handling
 
Exceptions in Java
Exceptions in JavaExceptions in Java
Exceptions in Java
 
Itp 120 Chapt 18 2009 Exceptions & Assertions
Itp 120 Chapt 18 2009 Exceptions & AssertionsItp 120 Chapt 18 2009 Exceptions & Assertions
Itp 120 Chapt 18 2009 Exceptions & Assertions
 
Exception handling
Exception handlingException handling
Exception handling
 
JP ASSIGNMENT SERIES PPT.ppt
JP ASSIGNMENT SERIES PPT.pptJP ASSIGNMENT SERIES PPT.ppt
JP ASSIGNMENT SERIES PPT.ppt
 
Exceptions overview
Exceptions overviewExceptions overview
Exceptions overview
 
Advantages Over Conventional Error Handling in OOP
Advantages Over Conventional Error Handling in OOPAdvantages Over Conventional Error Handling in OOP
Advantages Over Conventional Error Handling in OOP
 

More from ppd1961

Land of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel Tour
Land of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel TourLand of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel Tour
Land of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel Tour
ppd1961
 
Science & Culture Article with Editorial & Cover
Science & Culture Article with Editorial & CoverScience & Culture Article with Editorial & Cover
Science & Culture Article with Editorial & Coverppd1961
 
NDL @ YOJANA
NDL @ YOJANANDL @ YOJANA
NDL @ YOJANAppd1961
 
Unified Modeling Language (UML)
Unified Modeling Language (UML)Unified Modeling Language (UML)
Unified Modeling Language (UML)
ppd1961
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
ppd1961
 
Digital geometry - An introduction
Digital geometry  - An introductionDigital geometry  - An introduction
Digital geometry - An introduction
ppd1961
 
Innovation in technology
Innovation in technologyInnovation in technology
Innovation in technology
ppd1961
 
Kinectic vision looking deep into depth
Kinectic vision   looking deep into depthKinectic vision   looking deep into depth
Kinectic vision looking deep into depth
ppd1961
 
C++11
C++11C++11
C++11
ppd1961
 
Function Call Optimization
Function Call OptimizationFunction Call Optimization
Function Call Optimization
ppd1961
 
How To Define An Integer Constant In C
How To Define An Integer Constant In CHow To Define An Integer Constant In C
How To Define An Integer Constant In C
ppd1961
 
Stl Containers
Stl ContainersStl Containers
Stl Containers
ppd1961
 
Object Lifetime In C C++
Object Lifetime In C C++Object Lifetime In C C++
Object Lifetime In C C++
ppd1961
 
Technical Documentation By Techies
Technical Documentation By TechiesTechnical Documentation By Techies
Technical Documentation By Techies
ppd1961
 
Vlsi Education In India
Vlsi Education In IndiaVlsi Education In India
Vlsi Education In India
ppd1961
 
Reconfigurable Computing
Reconfigurable ComputingReconfigurable Computing
Reconfigurable Computingppd1961
 
Women In Engineering Panel Discussion
Women In Engineering   Panel DiscussionWomen In Engineering   Panel Discussion
Women In Engineering Panel Discussion
ppd1961
 
Dimensions of Offshore Technology Services
Dimensions of Offshore Technology ServicesDimensions of Offshore Technology Services
Dimensions of Offshore Technology Services
ppd1961
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
ppd1961
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0x
ppd1961
 

More from ppd1961 (20)

Land of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel Tour
Land of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel TourLand of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel Tour
Land of Pyramids, Petra, and Prayers - Egypt, Jordan, and Israel Tour
 
Science & Culture Article with Editorial & Cover
Science & Culture Article with Editorial & CoverScience & Culture Article with Editorial & Cover
Science & Culture Article with Editorial & Cover
 
NDL @ YOJANA
NDL @ YOJANANDL @ YOJANA
NDL @ YOJANA
 
Unified Modeling Language (UML)
Unified Modeling Language (UML)Unified Modeling Language (UML)
Unified Modeling Language (UML)
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
 
Digital geometry - An introduction
Digital geometry  - An introductionDigital geometry  - An introduction
Digital geometry - An introduction
 
Innovation in technology
Innovation in technologyInnovation in technology
Innovation in technology
 
Kinectic vision looking deep into depth
Kinectic vision   looking deep into depthKinectic vision   looking deep into depth
Kinectic vision looking deep into depth
 
C++11
C++11C++11
C++11
 
Function Call Optimization
Function Call OptimizationFunction Call Optimization
Function Call Optimization
 
How To Define An Integer Constant In C
How To Define An Integer Constant In CHow To Define An Integer Constant In C
How To Define An Integer Constant In C
 
Stl Containers
Stl ContainersStl Containers
Stl Containers
 
Object Lifetime In C C++
Object Lifetime In C C++Object Lifetime In C C++
Object Lifetime In C C++
 
Technical Documentation By Techies
Technical Documentation By TechiesTechnical Documentation By Techies
Technical Documentation By Techies
 
Vlsi Education In India
Vlsi Education In IndiaVlsi Education In India
Vlsi Education In India
 
Reconfigurable Computing
Reconfigurable ComputingReconfigurable Computing
Reconfigurable Computing
 
Women In Engineering Panel Discussion
Women In Engineering   Panel DiscussionWomen In Engineering   Panel Discussion
Women In Engineering Panel Discussion
 
Dimensions of Offshore Technology Services
Dimensions of Offshore Technology ServicesDimensions of Offshore Technology Services
Dimensions of Offshore Technology Services
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languages
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0x
 

Recently uploaded

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 

Recently uploaded (20)

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 

Handling Exceptions In C &amp; C++[Part A]

  • 1. Oct 04, 2007 Handling Exceptions in C++ Dr. Partha Pratim Das Interra Systems (India) Pvt. Ltd. PART A
  • 2.
  • 3.
  • 4.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. Exceptions in C A Recap of Error Handling Techniques
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32. Exceptions in C : Local goto _PHNDLR __cdecl signal(int signum, _PHNDLR sigact) { // Lifted from VC98RTRCINSIG.C ... /* Check for sigact support */ if ( (sigact == ...) ) goto sigreterror; /* Not exceptions in the host OS. */ if ( (signum == ... ) { ... goto sigreterror; } else { ... goto sigretok; } /* Exceptions in the host OS. */ if ( (signum ...) ) goto sigreterror; ... sigretok: return(oldsigact); sigreterror: errno = EINVAL; return(SIG_ERR); }
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66. SEH in Microsoft-C Standard Exception Handling – A Precursor to Exception Handling in C++
  • 67.
  • 68.
  • 69.
  • 70. Exceptions in C++ Basic Notions
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107. Exception Specification : Compiler Workaround is equivalent to void SomeFunction() throw (E1, E2) { ... } void SomeFunction() try { ... } catch (E1) { throw; } catch (E2) { throw; } catch (...) { std::unexpected(); }
  • 108. Standard Exceptions in C++ Classes, Types and Functions
  • 110.
  • 111.
  • 112.
  • 113.
  • 114.
  • 115.
  • 116.
  • 117.
  • 118.
  • 119.
  • 120. Handling Exceptions in C & C++ References & Credits
  • 121.

Editor's Notes

  1. Ignore: Do not catch. Act: Catch, handle and re-throw Own: Catch and handle
  2. Ignore: Do not catch. Act: Catch, handle and re-throw Own: Catch and handle
  3. Discuss the roles of jmp_buf (including its reuse at multiple points in the code) and int (as an encoded exception object - much like the return value). They provide scalability - Multiple buffers, multiple assignments to buffers and multiple return values. Note that this mechanism merges the advantages of goto and return value and offers more. It offers the basic control for exception handling in C++ (sans the local object cleanup)
  4. Green arrows show the normal flow. Red one shows abnormal flow. Oval areas correspond to try, catch and throw.
  5. Can be asynchronous - interrupt driven. Discuss the semantics for raise() and signal(). Highlight why this can be nearest to exception handling in C++.