MaksNew

Untitled

Jan 23rd, 2021
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. int main()
  2. {
  3.     SetConsoleCP(1251);
  4.     SetConsoleOutputCP(1251);
  5.     setlocale(LC_ALL, "ru");
  6.     worker demo("вован", 1, 2, 3, 4, 5, 6);
  7.     string path = "C:\\Users\\Max\\Desktop\\JAVAFILE.txt";
  8.  
  9.     ofstream fout;
  10.     fout.open(path, ios_base::trunc);
  11.  
  12.     fout.write((char*)&demo, sizeof(worker));
  13.  
  14.     fout.close();
  15.  
  16.     worker buf;
  17.     ifstream fin;
  18.     fin.open(path);
  19.     while (fin.read((char*)&buf, sizeof(worker)))
  20.     {
  21.         cout << buf.name << " " << buf.detailsOnMonday << " " << buf.detailsInTuesday << " " << buf.detailsInWednesday << " " << buf.detailsInThursday << " " << buf.detailsOnFriday << " " << buf.detailsOnSaturday << endl;
  22.     }
  23.     fin.close();
  24.     //showMenu();
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment