“warning: useless storage class specifier in empty declaration” in struct

前端 未结 4 794
悲&欢浪女
悲&欢浪女 2021-02-05 17:37
typedef struct item {
    char *text;
    int count;
    struct item *next;
};

So I have this struct with nodes defined as above, but Im getting the er

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-05 18:12

    The typedef is useless because you didn't give it a name. You cannot use the typedef in any way. That's why you get a warning, because the typedef is useless.

提交回复
热议问题