Guest User

Untitled

a guest
Oct 18th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. struct Node{
  2. int num;
  3. struct Node *prox;
  4. };
  5. typedef struct Node node;
  6.  
  7. int tam;
  8.  
  9. int vazia(node *LISTA)
  10. {
  11. if(LISTA->prox == NULL)
  12. return 1;
  13. else
  14. return 0;
  15. }
  16.  
  17. node *aloca()
  18. {
  19. node *novo=(node *) malloc(sizeof(node));
  20. if(!novo){
  21. printf("Sem memoria disponivel!n");
  22. exit(1);
  23. }else{
  24. printf("Novo elemento: ");
  25. scanf("%d", &novo->num);
  26. return novo;
  27. }
  28. }
Add Comment
Please, Sign In to add comment