Advertisement
daniele2013

correzione_codice

May 11th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. pNode lastInsert(pNode top, int value)
  2. {
  3.     pNode app;
  4.     if(top != NULL)
  5.         top->next = lastInsert(top->next,value);
  6.     else
  7.     {
  8.         app=(pNode)malloc(sizeof(node));
  9.         app->info = value;
  10.         app->next = NULL;
  11.         return app;
  12.     }
  13.     return top;
  14. }
  15.  
  16. void printList(pNode top)
  17. {
  18.     pNode app = top;
  19.     while(app != NULL)
  20.     {
  21.        printf("%d -> ", app->info);
  22.        app = app->next;
  23.     }
  24.     puts("NULL\n");
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement