Advertisement
Dinmrmr

regisrtation

Nov 28th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <clocale>
  4. #include <string>
  5. #include <fstream>
  6.  
  7. using namespace std;
  8.  
  9. struct Reg
  10. {
  11.     string login;
  12.     string password;
  13. };
  14.  
  15. void  registr()
  16. {
  17.     Reg user;
  18.     ofstream out("Data.bin", ios_base::binary | ios_base::app);
  19.     cout << "Введите логин: ";
  20.     cin >> user.login;
  21.     cout << "Введите пароль: ";
  22.     cin >> user.password;
  23.     out.write(reinterpret_cast<char*>(&user), sizeof(Reg));
  24.     out.close();
  25. }
  26.  
  27.  
  28. int main()
  29. {
  30.     setlocale(LC_ALL, "russian");
  31.     registr();
  32.     system("pause");
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement