#include<iostream> #include<fstream> #include<conio.h> using namespace std; int main() { char InFile[80]; char ch; ifstream InStream; cout<<"Enter input file name: " ; cin>>InFile; //open the file // in.open(fin); InStream.open(InFile, ios::in); // check the file if(!InStream) { cout << "Error open file " << InFile << endl; getch(); //system("pause"); } cout << "Here is the content of " << InFile << ": "; while (!InStream.eof()) { //Read each character. InStream.get(ch); // make sure we don't write any odd characters on screen if (!InStream.eof()) { cout << ch; //Write to screen getch(); // system("pause"); } } InStream.close(); }
getch()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)