Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ElementLoeschen(int SucheL)
- {
- int Gefunden = 0;
- struct Entry *rootK;
- struct Entry *Buffer = NULL;
- rootK = root;
- if(rootK == NULL)
- {
- printf("Kein Eintrag\n\n");
- return;
- }
- else
- {
- for(rootK;rootK != NULL; Buffer=rootK, rootK=rootK->next)
- {
- if((rootK->data) == SucheL)
- {
- if(root==rootK)
- {
- root = NULL;
- }
- else if(Buffer != NULL)
- {
- Buffer->next=rootK->next;
- rootK->next=NULL;
- rootK=Buffer->next;
- }
- else if((rootK->next) == NULL)
- {
- Buffer->next=NULL;
- }
- else
- {
- root=rootK->next;
- }
- Gefunden = 1;
- }
- }
- }
- printf("\n");
- if(Gefunden == 0)
- printf("Kein Eintrag unter dieser Suche\n\n");
- }
Add Comment
Please, Sign In to add comment