【发布时间】:2011-01-20 18:03:22
【问题描述】:
使用 fwrite 返回成功写入文件的元素数,方法是:
if (!(fwrite(...))) {
fprintf(stderr, "Failure");
//perror(???) I sometimes see code that says perror here and I don't know
//exactly what this does.
}
这是否检查是否成功写入文件?还有其他需要担心的事情吗?
谢谢。
【问题讨论】: