#include "averiles.h" typedef struct List{ struct List *next; int val; }* Liste; Liste deleteAll(Liste x){ Liste y; while(x!=NULL){ y=x; x=x->next; free(y); } return x; } void print(Liste x) { Liste ptr; for (ptr= x; ptr!= NULL; ptr=ptr->next) { printf("%d -> ", ptr->val); } printf("\n"); } int main() { init(); Liste y,z; int value; value=0; y=NULL; while(any){ z=malloc(sizeof(struct List)); z->next=y; z->val=value; value=value+1; y=z; } printf("Original sequence \n"); print(y); z=deleteAll(y); printf("deleted sequence \n"); print(z); }