The program would have to work with lists in C. It has to be able to read integers that the user enters and make operations with these numbers, such as insert elements in front, show an element and also the possibility of deleting an element entered. But pull the following errors in design time
#ifndef _Lista
#define _Lista
typedef struct
{
int info, sig;
} nodoL;
typedef nodoL* lista;
void insFront(lista *L, int n);
int mostrar(lista L);
void borrar(lista *L, int n);
#endif
File myLista.c
#include <stdio.h>
#include <stdlib.h>
#include "myLista.h"
void insFront (lista *L, int n){
lista aux = malloc(sizeof(nodoL));
aux -> info = n;
aux -> sig = L;
L=aux;
printf("Se agrego el %d a la lista\n",n);
}
int mostrar(lista L){
int i=0;
if (L!=NULL){
i=1;
printf(" |%d|->",L->info);
mostrar(L->sig); //<-warning: passing argument 1 of 'mostrar' makes pointer from integer without a cast [enabled by default]|
}
return i;
}
void borrar(lista *L, int n){
lista aux = *L;
*L = *L -> sig; //<-error: request for member 'sig' in something not a structure or union
free (aux);
}
Shoot the following errors:
warning: passing argument 1 of 'show' makes pointer from integer without a cast [enabled by default] |
error: request for member 'sig' in something not to structure or union |
How can you solve those errors?