ok, ho fatto
ora il problema è che ad ogni ciclo non creo un nuovo elemento di temp, ma modifico solamente info e il next punta a se stesso giusto?codice:void decToEsL (int a, Listchar *l){ Listchar temp; temp=malloc(sizeof(Listchar)); char dict[]= {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; if (a) while (a){ temp->info = dict [a%16]; temp->next=*l; *l=temp; a=a/16; } else{ temp->info = '0'; temp->next = NULL; *l=temp; } }

Rispondi quotando