Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     char word[50];
  8.     fstream file;
  9.     file.open("C://users//username//desktop//document.txt");
  10.     if (!file.is_open())
  11.     {
  12.     return 0;
  13.     }
  14.     else
  15.     {
  16.     while (file.good())
  17.     {
  18.         file >> word;
  19.             cout << word << " ";
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement