Advertisement
MARSHAL327

Untitled

Nov 21st, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. int read_bin_file(string filename, time_task** beg, time_task** end) {
  2.     total_el = 0;
  3.  
  4.     ifstream fin;
  5.     fin.open(filename);
  6.  
  7.     if (!fin) {
  8.         MessageBox(0, L"Нет файла!", L"Ошибка", MB_ICONERROR | MB_SETFOREGROUND);
  9.         return 1;
  10.     }
  11.  
  12.     fin.seekg(ios::beg);
  13.     time_task* t = new time_task;
  14.     t->next = NULL;
  15.     t->prev = NULL;
  16.     *beg = 0;
  17.    
  18.     while ( fin.read((char*)& t->d, sizeof(t->d)) ) {
  19.         if (*beg) {
  20.             cout << t->d.all_time << endl;
  21.             system("pause");
  22.             *end = input(*end, *t);
  23.         } else {
  24.             *beg = input(*t);
  25.             *end = *beg;
  26.         }
  27.  
  28.         total_el++;
  29.     }
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement