C语言stderr、errno、strerror、perror stderr 是标准错误输出,类型为 FILE* ; errno 宏是运行时最近一次的错误代码,正常运行时值为 0; strerror() 函数用于获取 errno 错误代码对应的错误信息字符串; perror() 函数用于打印 errno 的错误信息。是一个封装的帮助函数。 #include <stdio.h> #include <stdlib.h> #include <errno.h>