Advertisement
Guest User

scan

a guest
Jun 30th, 2015
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.83 KB | None | 0 0
  1. //в четырехугольном классе
  2. istream& operator>>(istream &in, quadrangle &q)
  3. {
  4.     point a;
  5.     for (int i = 0; i < 4; i++)
  6.     {
  7.         in >> a.x >> a.y;
  8.         q.table[i].x = a.x;
  9.         q.table[i].y = a.y;
  10.     }
  11.     if (!in)
  12.         throw "Error of reading!";
  13.     return cin;
  14. }
  15. //майн
  16. void scanF(FILE *f, node *first)
  17. {
  18.     ifstream in(f);
  19.     node *tmp=first, *newtmp;
  20.     while (!feof(f))
  21.     {
  22.         fflush(stdin);
  23.         newtmp = new node;
  24.         try
  25.         {
  26.             in >> newtmp->info;
  27.         }
  28.         catch (char *error)
  29.         {
  30.             cerr << error << endl;
  31.         }
  32.         if (in)
  33.         {
  34.             tmp->next = newtmp;
  35.             newtmp->prev = tmp;
  36.             newtmp->next = 0;
  37.             tmp = tmp->next;
  38.         }
  39.         in.clear();
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement