C - Setting a struct to null (incompatible types in assignment)

后端 未结 4 1852
旧时难觅i
旧时难觅i 2021-02-10 02:46

I have the following struct:

struct elem {
  int number;
  char character;
};

struct item {
  struct elem element;
};

and the following functi

4条回答
  •  盖世英雄少女心
    2021-02-10 03:13

    In addition to the previous answers, sometimes it makes sense to create a NULL struct. http://en.wikipedia.org/wiki/Null_Object_pattern

提交回复
热议问题