One detail you can't see from the output is that perror() writes its message to the standard error channel (stderr); the printf() call in Listing 1 is writing to the standard output channel (stdout).
您无法从输出中看到的一个细节是,perror() 将其消息写入标准错误通道 (stderr); 清单 1 中的 printf() 调用将写入标准输出通道 (stdout)。
The perror and strerror functions that pull standard error descriptions come from the global variable, sys_errlist.
引出标准错误描述的perror和strerror函数来自sys_errlist全局变量。
应用推荐