• mina86@lemmy.wtf
      link
      fedilink
      English
      arrow-up
      13
      ·
      3 天前

      Tag is what goes after the struct keyword to allow referring to the struct type. Structs don’t have to have a tag. Name is what field are called. Adapting Obin’s example:

      struct foo { int baz; };
      struct bar { struct foo qux; };
      struct bar data;
      data.foo.baz = 0;
      

      foo and bar are tags for struct foo and struct bar types respectively. And baz and qux are field names.