The purpose of the code is to print the values from linked lists.
Example of how the list is:
L-> [3] -> [4] -> [5] -> X,
should print 3, 4, 5. However it does not.
typedef struct lligada {
int valor;
struct lligada *prox;
} *LInt;
LInt insereL (LInt l, int x){
LInt new;
new = malloc(sizeof(struct lligada));
new->valor = x;
new->prox = l;
//printf("%d\n", new -> valor);
return new;
}
void imprimeL (LInt l){
while (l != NULL){
printf("%d\n", l -> valor);
l = l -> prox;
}
}
int main(){
LInt new;
insereL(new, 5);
insereL(new, 4);
insereL(new, 3);
imprimeL(new);
//freeL(new);
//puts("Hello World!");
return EXIT_SUCCESS;
}