Advertisement
MARSHAL327

Untitled

Nov 22nd, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. list* readoutbinarfile(list* l,list* r)
  2. {
  3.     int d = 0;
  4.  
  5.     ifstream in("2.txt",ios::in ,ios::binary);
  6.  
  7.     in.seekg(ios_base::beg);
  8.     list* t = new list,
  9.           *t1 = new list;
  10.     t->next = NULL;
  11.     t->pre = NULL;
  12.     l = 0;
  13.  
  14.  
  15.     while (in.read((char*)& t->inf, sizeof(t->inf)) )
  16.     {
  17.         d++;
  18.         if (d == 1)
  19.         {
  20.            
  21.             l = t;
  22.             t1 = l;
  23.             r = t;
  24.         }
  25.         else
  26.         {
  27.             t->pre = r;
  28.             r->next = t;
  29.             r = t;
  30.         }
  31.     };
  32.  
  33.     in.close();
  34.     return l;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement