CSCD 240 Lab 7: To Turn in
CSCD 240 Lab 7: To Turn in
Lab 7
1. In Java you most likely created a FileUtil class. Lets emulate that same concept in C.
Create fileutil.c and fileutil.h
Create an openInputFile function that takes a char array as the parameter, representing
the filename. The function will open that file for reading and return the FILE pointer. If
the file does not exist you must reprompt until the file exists and is open.
Create promptOpenInputFile function that prompts the user for the filename, the
function will open that file for reading and return the FILE pointer. If the file does not
exist it will continue to prompt for the filename.
Create an openOutputFile function that takes a char array as the parameter, representing
the filename. The function will open that file for writing and return the FILE pointer. If
the file cant be opened the function will print an error message and exit the program.
Create promptOpenOutputFile function that prompts the user for the filename, the
function will open that file for writing and return the FILE pointer.
TO TURN IN:
Name your zip your last name first letter of your first name lab7.zip (Example steinerslab7.zip)