ora mi dà un errore mai visto
errore
Inconsistency detected by ld.so: dl-fini.c: 50: _dl_fini: Assertion `_rtld_local._dl_nloaded > 0' failed!
codice
codice:#include <stdio.h> #include <stdlib.h> struct hello { int inf; struct hello *next; }; struct hello *creaPrimo(int ins); struct hello *creaAltri(int ins); main() { int ins; struct hello *p, *paus; struct hello *listaPtr; printf("Inserisci il primo elemento:\n"); scanf("%d", &ins); /* Caso primo elemento */ if(ins == 0) p = NULL; else { listaPtr = creaPrimo(ins); paus = p; /* Caso altri elementi */ do { printf("Inserisci elementi successivi:\n"); scanf("%d", &ins); listaPtr = creaAltri(ins); } while (ins != 0); paus->next = NULL; } } struct hello *creaPrimo(ins) { int size; struct hello *p; size = sizeof(struct hello); p = (struct hello*)malloc(size); p->inf = ins; p->next = NULL; return p; } struct hello *creaAltri(ins) { int size; struct hello *p,*paus; size = sizeof(struct hello); paus = (struct hello*)malloc(size); paus->inf = ins; paus = paus->next; return p; }


Rispondi quotando