🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

C++ Workshop - Exceptions & Error Handling (Ch. 20)

Started by
-1 comments, last by JWalsh 17 years, 1 month ago

Welcome to the GDNet C++ Workshop – Ch. 20

For a complete introduction to this workshop, please look here. Workshop Overview This workshop is designed to aid people in their journey to learn beginning C++. This workshop is targeted at highly motivated individuals who are interested in learning C++ or who have attempted to learn C++ in the past, but found that without sufficient support and mentoring they were unable to connect all the pieces of this highly complex but powerful programming language. This is a 'guided' self-teaching C++ workshop. Each student is responsible for taking the time to read the material and learn the information. The community and tutors that arise out of this workshop are here for making the learning process run more smoothly, but are not obligated to baby-sit a person's progress. Because everyone will be working from the same textbook (Teach Yourself C++ in 21 days 5th Ed.), students may find it easier to get answers to the specific questions they might have. There is no minimum age requirement, and there is no previous programming experience required. Additionally, this workshop does not attempt to defend C++ as a language, nor does it attempt to demonstrate that C++ is either more or less useful then other programming languages for any particular purpose. People who intend to start a discussion about the differences between C++ and ANY other languages (except as are relevant to a particular discussion), are encouraged to do so elsewhere. This workshop is for educational, not philosophical discussions. Quizzes & Exercises Each week will have quizzes and exercises posted in the weekly threads. Please try and answer them by yourself. As well, please DO NOT post the answers to Quizzes and Exercises within this thread. Once it becomes acceptable to post the answers to quizzes and exercises, an additional thread will be created each week specifically for the purpose of posting quiz answers. If you try with reasonable effort but are unable to answer the questions or complete the exercises, feel free to post a clarification question here on the thread. Tutors, myself, or others will do the best we can to point you in the right direction for finding the answer.

Chapter 20 – Handling Errors and Exceptions

Introduction The second to last chapter in the book is dedicated to the topic of error handling, exceptions, and debugging. Ironically, the second half of this chapter on debugging, etc...might well have been a useful second or third chapter, before the people reading the textbook spent hours, if not days, trying to debug the mistakes that were no doubt made while copying the contents of the code samples from the textbook, into their IDE. But I digress. The majority of the chapter is spent discussion exception handling, exception classes, throwing, and catching. More detail is then spent on unique cases such as exceptions and templates, and using exception handling techniques to deal with stack unwinding, etc...As described above, the chapter ends with a (VERY) brief section on debugging by setting breakpoints, watching points, using your IDE's memory window, and dissassembler. Outline of the Reading - Chapter 20
  1. Bugs, Errors, Mistakes, and Code Rot
  2. The Idea Behind Exceptions
  3. Placing try Blocks and catch Blocks
  4. How Catching Exceptions Works
  5. Data in Exceptions and Naming Exception Objects
  6. Exceptions and Templates
  7. Exceptions Without Errors
  8. A Word About Code Rot
  9. Bugs and Debugging

Good Luck!

[Edited by - jwalsh on May 30, 2007 5:38:13 PM]
Jeromy Walsh
Sr. Tools & Engine Programmer | Software Engineer
Microsoft Windows Phone Team
Chronicles of Elyria (An In-development MMORPG)
GameDevelopedia.com - Blog & Tutorials
GDNet Mentoring: XNA Workshop | C# Workshop | C++ Workshop
"The question is not how far, the question is do you possess the constitution, the depth of faith, to go as far as is needed?" - Il Duche, Boondock Saints

This topic is closed to new replies.

Advertisement