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

How can I do it in C?

Answer: 
In C you could use the combination of the `setjmp()` and `longjmp()` functions, defined in `setjmp.h`. [Example from Wikipedia](http://en.wikipedia.org/wiki/Setjmp.h)

```
#include <stdio.h>
#include <setjmp.h>

static jmp_buf buf;

void second(void) {
    printf("second\n");         // prints
    longjmp(buf,1);             // jumps back to where setjmp 
                                //   was called - making setjmp now return 1
}

void first(void) {
    second();
    printf("first\n");          // does not print
}

int main() {   
    if ( ! setjmp(buf) ) {
        first();                // when executed, setjmp returns 0
    } else {                    // when longjmp jumps back, setjmp returns 1
        printf("main");         // prints
    }

    return 0;
}

```

**Note:** I would actually advise you **not** to use them as they work awful with C++ (destructors of local objects wouldn't get called) and it is really hard to understand what is going on. Return some kind of error instead.
C doesn't have exceptions.

There are various hacky implementations that try to do it (one example at: <http://adomas.org/excc/>).