<cerrno> Header File

Hello, I'm wondering what <cerrno> or <errno.h> does and how is it implemented into the code itself

It's a header, it contains some preprocessor macros: http://en.cppreference.com/w/cpp/header/cerrno

it's implemented something like
1
2
3
#define EDOM   33
#define EILSEQ 84
#define ERANGE 34 
etc etc..
(it also declares the errno macro itself)

See http://en.cppreference.com/w/cpp/error/errno
and http://en.cppreference.com/w/cpp/error/errno_macros regarding the usage of these macros.
so what you mean is that when you want to throw an error, you could just type the keyword, for easier programming, (much alike return 0 and return EXIT_SUCCESS)?
closed account (Dy7SLyTq)
you dont throw errors in c, which is what errno is. in c, you have to do error handling all your self and all of the functions set the state of errno and your supposed to test its current state of errno and based on it you have to fix the issue. perosnally i wouldnt use it
Topic archived. No new replies allowed.