I try to access \"next\" in another structure, but failed although i have tried many ways.
Here is the nested structure:
struct list_head {
struct l
list
is not declared as a pointer, so you don't use the ->
operator to get its members, you use the .
operator:
while (d->list.next != NULL) {
}
A different fix:
typedef struct {
char *key;
char *value;
struct list_head *list;
}dict_entry;
This way, your original code attempting to refer to next
would compile.