Hi. What is the difference in using >
fprintf (stderr, "Error reading file" );
exit(1);
when dealing with error checking while opening a file?
as opposed to using >
printf ("Error reading file");
exit(1);
wouldn't they both accomplish the same thing (printing an error to
standard output)?
I can see that in the 'fprintf' something is sent to stderr. But what is sent to stderr? exit(1) ?
Just basically want to know the advantage of using the fprintf as opposed to just printing "Error reading file" and sending an 'exit(1)'.
thanks