结构中的匿名结构中的花括号或等同初始值设定项对VS2013产生的输出没有做任何工作。有代码: #include <iostream>
#include <cstdint>
struct S
{
struct
{
uint64_t val = 0;
}anon;
};
int main()
{
S s;
S *a = n
我想知道是否有可能在ANSI C.声明匿名结构我的代码是: struct A
{
int x;
};
struct B
{
struct A;
int y;
};
当我编译它,我得到: 警告:不申报不申报任何 我已阅读该标志-fms-extensions的伎俩,但它仅适用于Windows系统,因为它产生: 警告:匿名结构是微软扩展[-Wmicrosof
下面的示例代码private修饰符编译在Visual C++就好: class Test {
private:
struct {
struct {
int privateData;
};
};
};
int main(int, char **)
{
Test test;
test.privateData = 0