//************************************************************************** // header file for a library of auxiliary input output functions -- myio.h //************************************************************************** #ifndef MYIO_H #define MYIO_H #include using namespace std; void clrStream(); // Remove all data from the cin stream up to // and including the next new line character. char getResponse(char defalt); // Get a character from the cin stream. If the // character is a new line, return the // defalt otherwise return the character // entered. The cin stream is cleared void getValid(int& i); // Obtain a valid integer from cin stream. // The cin stream marker is left at the first // character after the integer obtained. void getValid(double& d); // Obtain a valid real number from cin stream. // The cin stream marker is left at the first // character after the number obtained. void openIn(ifstream& iStr, string& filename); // Attach a file to a stream. // If unable to attach the given file, it // will continue asking for a file until // a valid file is found and attached to iStr. // filename will contain the name of the // file attached. The cin stream is cleared. void openOut(ofstream& oStr, string& filename); // Attach a file to a stream. // If unable to attach the given file, it // will continue asking for a file until // a valid file is found and attached to oStr. // filename will contain the name of the // file attached. The cin stream is cleared. #endif