Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3. #include <string>
  4.  
  5. int main()
  6. {
  7.     using namespace std;
  8.     ifstream inf("userDB.dat");
  9.  
  10.     if (!inf)
  11.     {
  12.         cerr << "Cannot open userDB" << endl;
  13.         exit (1);
  14.     }
  15.  
  16.     while (inf)
  17.     {
  18.         std::string strInput;
  19.         inf >> strInput;
  20.         cout << strInput << endl;
  21.     }
  22.  
  23.     system("PAUSE");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement