O'Reilly logo

Sams Teach Yourself C++ in One Hour a Day, Seventh Edition by Siddhartha Rao

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 28. Exception Handling

The title says it all: dealing with extraordinary situations that disrupt the flow of your program. The lessons thus far have mostly taken an exceedingly positive approach, assuming that memory allocations will succeed, files will be found, and so on. Reality is often different.

In this lesson, you learn

• What is an exception

• How to handle exceptions

• How exception handling helps you deliver stable C++ applications

What Is an Exception?

Your program allocates memory, reads and writes data, saves to a file—the works. All this executes flawlessly on your awesome development environment, and you are even proud of the fact that your application doesn’t leak a byte, though it manages a gigabyte! You ship your application ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required