Question: I typed this into Google, but I only found how-tos in C++.

How can I do it in C?

Answer: 
There's no *built-in* exception mechanism in C; you need to *simulate* exceptions and their semantics. This is usually achieved by relying on `setjmp` and `longjmp`.

There are quite a few libraries around, and I'm implementing yet another one. It's called [exceptions4c](http://code.google.com/p/exceptions4c/); it's portable and free. You may take a look at it, and compare it against [other alternatives](http://code.google.com/p/exceptions4c/wiki/alternatives) to see which fits you most.
On Windows with **Microsoft Visual C++** (MSVC) there's `__try ... __except ...`, but it's really horrible and you don't want to use it if you can possibly avoid it. Better to say that there are no exceptions.