Advertisement
MARSHAL327

Untitled

Dec 11th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. void write_filetype(time_task *temp, string filename) {
  2.     ofstream fout; // файл в который производится запись данных
  3.  
  4.     // обработка ошибок
  5.     if (!fout) {
  6.         MessageBox(0, L"Невозможно открыть файл для записи!", L"Ошибка", MB_ICONERROR | MB_SETFOREGROUND);
  7.         return;
  8.     }
  9.  
  10.     fout.open(filename);
  11.  
  12.     while (temp) {
  13.         fout << temp->d.cipher << endl;
  14.         fout << temp->d.department_code << endl;
  15.         fout << temp->d.fio << endl;
  16.         fout << temp->d.all_time << endl;
  17.         fout << temp->d.time_cpu << endl;
  18.         temp = temp->next;
  19.     }
  20.  
  21.     // закрываем файлы
  22.     fout.close();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement