Is errnum an external variable like errno?

This is a discussion on Is errnum an external variable like errno? within the C++ Programming forums, part of the General Programming Boards category; The strerror library function definition is :
char *strerror (int errnum)
It will map the integer errnum argument (which can ...

You need to use errno itself. errno is set on an error in a system-level call. Because errno holds the value for the last call that set it, this value may be changed by succeeding calls. Always check errno immediately before and after a call that may set it.