Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "lista.h"
- #include <stdio.h>
- t_elem dodaj(t_elem *poczatek, int dane) {
- t_elem *nowy = (t_elem*) malloc(sizeof(t_elem));
- nowy->dane = dane;
- nowy->nast = poczatek;
- poczatek = nowy;
- return poczatek;
- }
- int usun(t_elem **poczatek) {
- int zwr_dane;
- t_elem *usuwany = *poczatek;
- *poczatek = (*poczatek)->nast;
- zwr_dane = usuwany->dane;
- free(usuwany);
- return zwr_dane;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement