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

How can I do it in C?

Answer: 
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.
In C we can't use try case to handle the error.
but if you can use Windows.h so you can:

```
#include <stdio.h>
#include <Windows.h>
#include <setjmp.h>
jmp_buf Buf;

NTAPI Error_Handler(struct _EXCEPTION_POINTERS *ExceptionInfo)
{
    printf("co loi roi ban oi.!!!\r\n");
    longjmp(Buf, 1);
}

void main()
{
    AddVectoredExceptionHandler(1, Error_Handler);
    int x = 0;
    printf("start main\r\n");
    if (setjmp(Buf) == 0)
    {
        int y = 1 / x;
    }
    printf("end main\r\n");

}

```