Next: , Previous: , Up: Error handling: Error codes   [Contents]


7.1.2 Motivation

Why is this important? Why do we want to learn/teach this topic?

C++ offers a type safe way of passing around errors, contrary to the C-style of error handling, by this, we prevent bugs when passing error codes. Furthermore, error handling with error codes is more commonly used than exception handling, which only should be used in exceptional situations and in some environments is not feasible at all, e.g., in embedded or performance critical software.