Please take a look this link: http://www.tutorialspoint.com/cprogramming/c_error_handling.htm