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
In your definition, you are defining list
to be an object as below
typedef struct {
char *key;
char *value;
struct list_head list; // This is an object
}dict_entry;
Hence, you will de-reference next
through the .
operator as d->list.next
. The first level of de-referencing i.e. d->list
requires ->
operator as d
is defined to be a pointer. For next
, since list
is an object and not a pointer, you would have to use .
operator.