36 ms·
I guess the argument is that the non-error-checking version fails at the "find out where your output went" stage. hello.c gives the impression that your output
by oneeyedpigeon 5y ago
I guess the argument is that the non-error-checking version fails at the "find out where your output went" stage. hello.c gives the impression that your output went to the file, even when it didn't.
Without a spec, I think it would be harsh to claim hello.c is wrong. But handling the error—in this case, returning it from main to the shell via an exit code—is definitely more correct.