将 perror 输出重定向到 fprintf(stderr, " ")
如果系统调用函数失败,我们通常使用 perror 来输出错误消息。我想使用 fprintf 输出 perror 字符串。我怎样才能做这样的事情:
fprintf(stderr, perror output string here);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
注意:strerror 不会将
\n
应用于消息末尾Note: strerror doesn't apply
\n
to the end of the message