Usage of “static” within a struct in C

后端 未结 6 1821
闹比i
闹比i 2020-12-18 18:53

Is it legal to have a \"static\" member within a C struct?

For example

struct my_struct {
    int x;
    static int y;
};

If indeed

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 19:48

    No, not in C

    (You can have a static member in a C++ structure.)

提交回复
热议问题