Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include "header.h"
- void addToHead(LDC *list)
- {
- llist *newCel = malloc(llist);
- newCel->next = list;
- }
- void addToList(LDC *list)
- {
- int choix2 = 0;
- do
- {
- printf("Choix: 1: Add to the list\n2: Remove from the list");
- scnaf("%d",&choix);
- }while((choix <= 0)|| (choix >2));
- switch(choix2)
- {
- case 1: addToHead(list);
- break;
- case 2: addToTail(list);
- break;
- }
- }
- void main()
- {
- LDC *list;
- list->next = NULL;
- list->prev = NULL;
- int choix = 0;
- do
- {
- printf("Choix: 1: Add to the list\n2: Remove from the list");
- scanf("%d",&choix);
- }while((choix <= 0)|| (choix >3));
- switch(choix)
- {
- case 1: addToList(list);
- break;
- case 2: removeFromList(list);
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement