My program asks the user for the name of the input file.
If the user screws up and enters nothing, or an incorrect filename, the program will crash. How can the program be directed to recognize that the specified file does not exist and instead of crashing, display an error message and exit.
the filename is put into a variable called inname, and then variable used to open the file. like so:
// Lets figure out what the user has called the file, and load it up
printf( "\n\n\tName of input file: " );
scanf( "%s", &inname );
inp = fopen(inname, "r");