Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # include <iostream>
- # include <fstream>
- # include <cstdlib>
- using namespace std;
- int main()
- {
- ifstream fin;
- char words;
- cout << "What is the name of the file? ";
- char file[20];
- cin >> file;
- fin.open(file);
- if (fin.fail())
- {
- cout << "The File" << file << " won't open" << endl;
- exit(1);
- }
- fin.get(words);
- while(!fin.eof())
- {
- cout << words;
- fin.get(words);
- }
- fin.close();
- return 0;
- }
Add Comment
Please, Sign In to add comment