- 博客(2)
- 资源 (5)
- 收藏
- 关注
原创 枚举类型不能重名的问题
老问题了,枚举在一个名称下不能出现重名,如enum Enum1{blue,green,yellow}enum Enum2{red,green,white}这两个枚举中的名称中的green重复了,编译器会报错。更改的方式,一是避免重名;二是添加引用空间;三个使用结构体添加不同的引用空间namespace A{enum Enum1{blue,green,yellow}}namespaceB{enum ...
2018-07-11 14:03:17 3503
原创 结构体初始化,结构体名称+小括号,struct()
结构体定义如下:位于.h文件中 struct Node { enum Type { Horizontal, Vertical, Leaf }; union { qreal offset; int leafIndex; }; Type type; };引用方法,测试为结构体名称+小括...
2018-07-11 13:52:33 5734 2
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人