C language perror function

C language perror function

Header file: #include<stdio.h>
Function prototype: void perror(char * string)
Function description: Output Outputs the cause of the latest error to standard error (stderr), where string will be output to standard error first, followed by Coupled with the error cause string, the error cause will be based on the value of the global variable errno
**errno global variable description: **There is an errno variable in the library function, and each errno value corresponds to the error type represented by a string. When you call "some" function with an error, that function has reset the value of errno. That is to say, the perror function just outputs some of the information you entered and the error corresponding to the current errno.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325116577&siteId=291194637