

strerror()               String Function               strerror()




Translate an error number into a string

#include <string.h>
cchhaarr *ssttrreerrrroorr(_e_r_r_o_r); iinntt _e_r_r_o_r;

strerror helps to generate  an error message.  It takes the argu-
ment error, which presumably is an error code generated by an er-
ror condition in a program, and  may return a pointer to the cor-
responding error message.

The error  numbers recognized and the  texts of the corresponding
error messages are set by COHERENT.

***** See Also *****

perror(), string functions, string.h

***** Notes *****

strerror returns  a pointer to  a static array that  may be over-
written by a subsequent call to strerror.

strerror  differs  from   the  related  function  perror  in  the
following ways:  strerror receives  the error number  through its
argument error,  whereas perror reads the  global constant errno.
Also, strerror  returns a pointer  to the error  message, whereas
perror  writes  the  message  directly  into the  standard  error
stream.

The error  numbers recognized and  the texts of  the messages as-
sociated with  each error number  are set by  COHERENT.  However,
strerror and perror return the same error message when handed the
same error number.























COHERENT Lexicon                                           Page 1


