Skip to content

'typedef list_item' not used in code example #28

@deltakid0

Description

@deltakid0

The first typedef is not being used making the code confusing for beginners:

struct list_item {
        int value;
        struct list_item *next;
};
typedef struct list_item list_item;

struct list {
        struct list_item *head;
};
typedef struct list list;

The only member on struct list doesn't need the keyword struct in case you actually wanted to use the typedef in mention so in the end, the implementation would be:

struct list {
        list_item *head;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions