Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. typedef struct list
  4. {
  5. int value;
  6. struct list *next;
  7. }list;
  8. void push(list **head,int data)
  9. {
  10. list *tmp=(list*)malloc(sizeof(list));
  11. tmp->value=data;
  12. tmp->next=*head;
  13. *head=tmp;
  14. }
  15. int main(void)
  16. {
  17. list *head;
  18. head=NULL;
  19. push(head,9);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement