結構中的匿名結構中的花括號或等同初始值設定項對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