Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
This week, we're updating our course layouts and descriptions. Presentation and materials always gently change over time, but just occasionally there's a need to make a step change to clear out some of the old and roll in the new. That's now happening - but over a long and complex site it's not instant and you'll see sections of the site changing up to and including 19th September.

See also [here] for status update
 

Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
C and C based languages module C236
Exceptions
Exercises, examples and other material relating to training module C236. This topic is presented on public courses Learning to program in C++, C++ for C Programmers, C and C++ Programming

Background
Error checking - anything from checking that the user has entered a valid respones to a question through to ensuring that a remote system you need to contact is available - is a vital part of any program. Sometimes, you can easily check things with a few if statements, but at other times it's much more practical to use an exception system where you call for a piece of code to be run, but then branch off to a particular handler is a certain condition is triggered.
Related technical and longer articles
errors v exceptions

Articles and tips on this subjectupdated
3509Operator Overloading, Exceptions, Pointers, References and Templates in C++ - new examples from our courses
I've added three new C++ examples to our library following on from last week's C++ course. Each of them is one step beyond "hello world" with regard to the particular feature it's showing, but isn't so advanced and showing so many options that it confuses the newcomer - at least that's the theory. ...
2011-11-06
 
3068Throwing your own exception in C++, and catching it
In C++ you can throw anything - it doesn't have to be something "throw-able" as in Java. 1. Create a class of objects that you want to throw in exceptional circumstances 2. When you want to throw an exception, use the throw keyword and pass in the object 3. Call the code that you want to catch the ...
2010-12-04
 
2622Handling unusual and error conditions - exceptions
"I can't answer that question in the way you expect" ... that's something that may be said to you occasionally - you ask someone what suit a playing card is that they're holding and they cannot tell you because it is a joker, or you ask what number is written on a piece of paper when the paper is blank. The ...
2010-02-03
 
1875What are exceptions - Python based answer
How do you check for run time errors in your program? You'll include tests with if statements in almost every program you write, to ensure that user entered data is reasonable / as you would expect ... but you will also need to do more that that. You'll need to check whether a system function has run ...
2008-11-08
 
799The case for exceptions
When you run a program, things can go wrong - run time errors. And no amount of coding by the programmer can prevent these things - it’s a user entering a string of text when a number’s required, a needed file having been deleted, or a network connection that’s broken that causes probems. In ...
2006-07-11
 
Examples from our training material
CppExcept.cpp   Creating exception objects, throwing and catching them
except.cpp   Exception handling - catches
levels.cpp   Exceptions - try, catch yourself AND throw to parent too
makefile   Compile / Load instructions for examples in this module
microthrow.cpp   Defining, throwing, catching an excpetion
prob.cpp   Exception handling - why we need it
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
What are exceptions?
Try and catch.
Exception heirarcy.
Accessing exception data.
Throwing your own exceptions.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 700 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.


You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/C236.html • PAGE BUILT: Wed Mar 6 10:39:20 2013 • BUILD SYSTEM: wizard