Definition | #include <stdio.h> void *perror(const char *s);
s : <short error message>\n The following error information is provided:
|
Notes |
If a NULL pointer is passed as argument s, only the The contents of the area in which the error code and the error text are stored are not explicitly deleted. This means that the previous contents are retained until they are overwritten with appropriate information when a fresh error occurs. Consequently, With KR functionality (applies to C/C++ versions prior to V3.0 only) a value of type |
Example | The following program opens the file fnam for reading. If the file does not exist, the following error message is printed on the standard output:
DD33 is the DMS error code. #include <stdio.h> int main(void) { FILE *fp; if((fp = fopen("fnam", "r")) == NULL) perror("Program fopen"); return 0; } |