• ifstream myFile; //
declare an input file stream
GetInputFile(myFile); //
call GetInputFile (See slide 4)
char
ch; // declare a char
variable
while ( myFile.peek() != EOF ) { // test if at the End Of File
myFile.get(ch); // read one character a time
cout
<< ch; // print the
character onto screen
}
myFile.close(); //
close the file stream