devxlogo

Structured Exception Handling and Standard Exception Handling

Structured Exception Handling and Standard Exception Handling

Many C compilers provide a non-standard feature called “structured exception handling”, or SEH for short. SEH can trap asynchronous, platform-specific exceptions such as division by zero, floating point overflow and underflow, and other hardware exceptions. In contrast, the standard C++ exception handling (EH) applies only to synchronous exceptions, i.e., exceptions that are generated by the program itself, and which are explicitly created by a throw statement.

The type of exceptions raised by SEH and EH, as well as their underlying mechanisms and recovery methods, are incompatible. Therefore, never confuse SEH with EH, or vice versa. In C, use SEH if necessary. In C++, stick to EH exclusively.

See also  How College Students Can Shape the Future of Tech Responsibility
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist