listings-Chap10-README.md
Listings of Chap10.docx
This is linked summary of the listings. You can also view it on one page.
- Listing 10.1: Respond to many states with different types of return values.
- Book: lst-0001-book.cpp
- Godbolt: lst-0001-godb.cpp, https://godbolt.org/z/EWqqGjnnz
- Listing 10.2: Exceptions are triggered with “throw” and handled with “try-catch”.
- Book: lst-0002-book.cpp
- Godbolt: lst-0002-godb.cpp, https://godbolt.org/z/j8abxvvvo
- Listing 10.3: A “catch” can also be within a loop.
- Book: lst-0003-book.cpp
- Listing 10.4: Using “throw” without parameters rethrows the currently handled exception.
- Book: lst-0004-book.cpp
- Listing 10.5: You can also throw exceptions of other types.
- Book: lst-0006-book.cpp
- Godbolt: lst-0006-godb.cpp, https://godbolt.org/z/67cd5bhhE
- Listing 10.6: At least output the error type and text instead of letting your program tumble out of “main”.
- Book: lst-0007-book.cpp
- Godbolt: lst-0007-godb.cpp, https://godbolt.org/z/TsP33njar