Error handling

Download c eBook


  • #include <errno.h>
  • int errno; /* implementation defined */
  • #include <string.h>
  • char *strerror(int errnum);
  • #include <stdio.h>
  • void perror(const char *s);


Have in mind that errno is not necessarily a variable but that the syntax is only an indication how it might been declared. On many modern systems with thread interfaces errno is some macro that resolves to an object that is local to the current thread.

Related Examples


106 Contributors: 2
Thursday, July 28, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial:

Download eBook