Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <string>
  2. #include <fstream>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. string input;
  10. string fileName;
  11. int x = 0;
  12.  
  13. cout << "Please enter your file name: ";
  14. cin >> fileName;
  15.  
  16. ifstream fin(fileName);
  17.  
  18. while (getline(fin, input)){
  19. cout << input << endl;
  20. x++;
  21. }
  22.  
  23. if (x < 10){
  24. cout << "The entire program has been displayed.";
  25. }
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement