Using GCC, I am trying to add simple exception logic to this program. Ideally, a simple "if" would work well. IF the fopen
succeeds then do x, if it fails do z. Is there a simple way to do this?
#include <stdio.h>
main()
{
FILE *ptr;
ptr = fopen("c:\\RedyBoot.bat","r");
fclose(ptr);
return 0;
}