SlideShare uma empresa Scribd logo
1 de 123
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

Mais conteúdo relacionado

Mais procurados

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 in c++ by manoj vasava
Exception handling in c++ by manoj vasavaException handling in c++ by manoj vasava
Exception handling in c++ by manoj vasavaManoj_vasava
 
Exception Handling in C++
Exception Handling in C++Exception Handling in C++
Exception Handling in C++Deepak Tathe
 
Exception handling
Exception handlingException handling
Exception handlingpooja kumari
 
Exception handler
Exception handler Exception handler
Exception handler dishni
 
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
 
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
 
Exception Handling
Exception HandlingException Handling
Exception HandlingReddhi Basu
 

Mais procurados (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
 

Destaque

Object Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionObject Oriented Programing JAVA presentaion
Object Oriented Programing JAVA presentaionPritom 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 RobotsJun 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 1Ali 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 16SDL
 
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 DifferencesDavina 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
 

Destaque (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+)
 

Semelhante a 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 LoggingRiccardo Cardin
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handlingAlpesh Oza
 
Week7 exception handling
Week7 exception handlingWeek7 exception handling
Week7 exception handlingAlpesh Oza
 
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 CourseVivek 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.pptxssusercd11c4
 
A exception ekon16
A exception ekon16A exception ekon16
A exception ekon16Max Kleiner
 
UNIT III.ppt
UNIT III.pptUNIT III.ppt
UNIT III.pptAjit 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 handlingRaja 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 handlingzindadili
 
JP ASSIGNMENT SERIES PPT.ppt
JP ASSIGNMENT SERIES PPT.pptJP ASSIGNMENT SERIES PPT.ppt
JP ASSIGNMENT SERIES PPT.pptJAYAPRIYAR7
 
Exceptions overview
Exceptions overviewExceptions overview
Exceptions overviewBharath 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
 

Semelhante a 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.ppt
UNIT III.pptUNIT III.ppt
UNIT III.ppt
 
UNIT III (2).ppt
UNIT III (2).pptUNIT III (2).ppt
UNIT III (2).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
 

Mais de 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 Tourppd1961
 
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 introductionppd1961
 
Innovation in technology
Innovation in technologyInnovation in technology
Innovation in technologyppd1961
 
Kinectic vision looking deep into depth
Kinectic vision   looking deep into depthKinectic vision   looking deep into depth
Kinectic vision looking deep into depthppd1961
 
Function Call Optimization
Function Call OptimizationFunction Call Optimization
Function Call Optimizationppd1961
 
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 Cppd1961
 
Stl Containers
Stl ContainersStl Containers
Stl Containersppd1961
 
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 Techiesppd1961
 
Vlsi Education In India
Vlsi Education In IndiaVlsi Education In India
Vlsi Education In Indiappd1961
 
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 Discussionppd1961
 
Dimensions of Offshore Technology Services
Dimensions of Offshore Technology ServicesDimensions of Offshore Technology Services
Dimensions of Offshore Technology Servicesppd1961
 
Concepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming LanguagesConcepts In Object Oriented Programming Languages
Concepts In Object Oriented Programming Languagesppd1961
 
Glimpses of C++0x
Glimpses of C++0xGlimpses of C++0x
Glimpses of C++0xppd1961
 

Mais de 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
 

Último

Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 

Último (20)

Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 

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.

Notas do Editor

  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++.