Advertisement
Guest User

Untitled

a guest
Jun 17th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. void LstInsert(struct elem *neu, struct elem *last){
  2.     struct elem *ptr;
  3.     if(root==NULL){
  4.         printf("Keine Elemente vorhanden!\n");
  5.         return;
  6.     } else {
  7.     ptr=root;
  8.     while(ptr!=NULL){
  9.         ptr=ptr->next;
  10.         if(ptr==NULL){
  11.             ptr=last;
  12.             last->next=neu;
  13.             neu=malloc(sizeof(struct elem));
  14.             neu->Messwert=ptr->Messwert;
  15.             neu->next=NULL;
  16.                        
  17.             }
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement