在我的程序中,fprintf()
返回-1,表示错误。我怎样才能找出实际的错误是什么?
最佳答案
#include <errno.h>
#include <string.h>
...
rc = fprintf(...)
if (rc < 0)
printf("errno=%d, err_msg=\"%s\"\n", errno,strerror(errno))
关于c++ - 如何找到 fprintf() 实际错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5726630/