typedef struct llist {
int valor;
struct lligada *prox;
} *LInt;
So this is how linked lists are implemented in C at my university and I have been wondering why in the last line they put a pointer to LInt instead of just LInt.
typedef struct lligada {
int valor;
struct lligada *prox;
} LInt;
Wouldn't this be simpler? I mean it's this last example that I see in tutorials around the web and if we want a pointer to the struct we would just write something like
LInt *foo = ...;
What confuses me is that they declare the pointer in the struct and in the exercises they still do the declaration above. Is there any special reason for this? Is this normal? They also do this for binary trees.