Your question is a bit vague and there seem to be several copying mistakes.
Firstly, the last line is not a typedef but a declaration of a pointer to struct Linkedlist.
The typedef is used for convenience. Without the typedef you'd have to delcare the pointer the following way:
Code:
struct linkedlist {
struct linkedlist *nextptr;
char data ;
};
struct linkedlist *Linkedlistptr;
Since it might be inconvenient to add the struct keyword each time you want to delare a linkedlist pointer (instance), you can use the typedef to remove the need of it:
Code:
struct linkedlist {
struct linkedlist *nextptr;
char data ;
};
typedef struct linkedlist Linkedlist;
Linkedlist *Linkedlistptr;
What happens is that for the compiler Linkedlist translates to struct linkedlist, as in the previous snippet.
May-be more usual, but equivalent way to create this typedef is
Code:
typedef struct linkedlist {
struct linkedlist *nextptr;
char data ;
} Linkedlist;
Linkedlist *Linkedlistptr;