Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
システムコール関数が失敗した場合、通常は perror を使用してエラーメッセージを出力します。fprintf を使用して perror 文字列を出力したいと考えています。どうすればこのようなことができますか:
fprintf(stderr, perror output string here);
#include <errno.h> fprintf(stderr, "%s\n", strerror(errno));
\n注: strerror はメッセージの最後には適用されません
\n