Advertisement
Fructus

Untitled

Apr 1st, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. void searchz(list *h, list **h2, list **last2)
  2. {
  3.     list *p = h;
  4.     system("cls");
  5.     while(p)
  6.     {
  7.         if (strcmp(p->info.pos,"RB")==0 || strcmp(p->info.pos,"CB")==0 || strcmp(p->info.pos,"LB")==0)
  8.         if (h2==NULL)
  9.         {
  10.             add_start1(h2,last2,p->info.name);
  11.         }
  12.         else
  13.         {
  14.             add_end1(last2,p->info.name);
  15.         }
  16.         p = p -> next;
  17.     }
  18.     system("pause");
  19.     system("cls");
  20.  
  21. }
  22.  
  23.  
  24. void add_start1(list **h2, list **last2, char *g)
  25. {
  26.     list *p = (list*)malloc(sizeof(list));
  27.     strcpy_s(p->info.pos, 1 ,NULL);
  28.     strcpy_s(p->info.surname, 1 ,NULL);
  29.     strcpy_s(p->info.league, 1 ,NULL);
  30.     strcpy_s(p->info.name, 100 ,g);
  31.     if (!*h2)
  32.         *last2 = p;
  33.     p->next = *h2;
  34.     *h2 = p;
  35. }
  36.  
  37. void add_end1(list **last2, char *g)
  38. {
  39.  
  40.         list *p = (list*)malloc(sizeof(list));
  41.         system("cls");
  42.         strcpy_s(p->info.name, 100 ,g);
  43.         (*last2)->next = p;
  44.         p->next = NULL;
  45.         *last2 = p;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement