I know there are some posts just like this one, but all solutions on those posts didn't help me, and they tended to just say switching l.valor to l->valor, and that is not working in my case, and I don't understand why.
This is what I have:
typedef struct lligada {
int valor;
struct lligada *prox;
} *LInt;
void insertOrd (LInt *g, int x){
if (g != NULL) g->valor = x;
}
And I am getting this:
error: request for member 'valor' in something not a structure or union if (g == NULL) g->valor = x;
What am I doing wrong?
PS: This is an exercise on a platform called codeboard, it is homework, I can't change the struct declaration, nor can I change the arguments of the function insertOrd, I have to use what I get on insertOrd and make the function work