Chapter 11. Exception Handling

After completing this chapter, you will be able to:

  • Explain what exceptions are.

  • Recognize the different types of exceptions that can be used in C++/CLI.

  • Describe how to generate exceptions.

  • Explain how to handle exceptions.

  • Create your own exception classes.

Now that you know how to construct classes and value types and use them in programming, this chapter introduces you to exception handling, a powerful way of managing errors within C++ applications.

What are exceptions?

Exceptions are an error-handling mechanism employed extensively in C++ and several other modern programming languages. Traditionally, error and status information is passed around by using function return values and parameters, as demonstrated in the ...

Get Microsoft Visual C++/CLI Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.