Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. void dodajDoListy(undoredo *&head, undoredo *&tail)
  2. {
  3.     int m = 0;
  4.     undoredo *nowy = new undoredo; //wydzielam pamiec dla nowego elementu listy
  5.     tail = head;
  6.  
  7.     for (int i = 0; i < SIZE; i++){
  8.         for (int j = 0; j < SIZE; j++){
  9.             nowy->stany[m] = plansza[i][j].pole;
  10.             m++;
  11.         }
  12.     }
  13.  
  14.     if (head == NULL)
  15.     {
  16.         head = nowy;
  17.         head->next = nowy;
  18.     }
  19.     else
  20.     {
  21.         while (tail->next != NULL){}
  22.         tail->next = nowy;
  23.         nowy->prev = tail;
  24.     }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement