C:的使用和QUOT;静态"一个结构内 [英] C: usage of "static" within a struct

查看:113
本文介绍了C:的使用和QUOT;静态"一个结构内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是合法的有一个C结构中的静态的成员?

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

例如

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

如果它确实是合法的,那么什么是静态关键字的用法的含义是什么?

If indeed it is legal,then what are the implications of the usage of the "static" keyword?

在此先感谢
MNO。

Thanks in advance Mno.

推荐答案

没有,那将毫无意义的C.它是有效的在C ++中虽然。

No, that would make no sense in C. It's valid in C++ though.

这篇关于C:的使用和QUOT;静态"一个结构内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆