I am trying to include statements that instruct the user a little bit more about why a file failed to open or close. What are some possible situations where a file would fail to open in write mode and what about failing to close?
FILE *fp;
if(!(fp = fopen("testing", "w")))
{
fprintf(stderr, "\nError %d: Loading from \"testing\" file failed: %s\n",
errno, strerror(errno));
printf("Add additional explanations here\n");
}
fclose(fp);