Advertisement
austecliano

Inserção Lista

Sep 11th, 2011
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. Tlista *Insere(Tlista *L, int info) {
  2.     Tlista *Aux, *temp;
  3.     Aux = (Tlista*) malloc(sizeof (Tlista));
  4.     Aux->info = info;
  5.     Aux->prox = NULL;
  6.     if (L == NULL)
  7.         L = Aux;
  8.     else {
  9.         temp = L;
  10.         while (temp->prox != NULL){
  11.             temp = temp->prox;
  12.         }
  13.         temp->prox = Aux;
  14.     }
  15.    
  16.     return L;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement