Advertisement
dulek55

Untitled

Jan 27th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include "lista.h"
  2. #include <stdio.h>
  3.  
  4. t_elem dodaj(t_elem *poczatek, int dane) {
  5. t_elem *nowy = (t_elem*) malloc(sizeof(t_elem));
  6. nowy->dane = dane;
  7. nowy->nast = poczatek;
  8. poczatek = nowy;
  9. return poczatek;
  10. }
  11.  
  12. int usun(t_elem **poczatek) {
  13. int zwr_dane;
  14. t_elem *usuwany = *poczatek;
  15. *poczatek = (*poczatek)->nast;
  16. zwr_dane = usuwany->dane;
  17. free(usuwany);
  18. return zwr_dane;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement