Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <clocale>
- #include <string>
- #include <fstream>
- using namespace std;
- struct Reg
- {
- string login;
- string password;
- };
- void registr()
- {
- Reg user;
- ofstream out("Data.bin", ios_base::binary | ios_base::app);
- cout << "Введите логин: ";
- cin >> user.login;
- cout << "Введите пароль: ";
- cin >> user.password;
- out.write(reinterpret_cast<char*>(&user), sizeof(Reg));
- out.close();
- }
- int main()
- {
- setlocale(LC_ALL, "russian");
- registr();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement