3
When reading my teacher’s slides I was left with a question regarding this structure:
struct node
{
char item;
struct node *next;
};
typedef struct node Node;
typedef node *Lista;
It wasn’t clear to me why typedef node *Lista
, because I thought there was already a pointer to the next struct
. Could someone explain to me why?
So
Lista
would be a pointer previously created to access the first element? Why couldn’t I do this just by making a Node->next?– João Victor Vilar
That would be it. You can’t do direct access because you don’t have an item when you start. In fact, if you want to do it is you who has to say how you will, I don’t see how you could.
– Maniero