小编Nik*_*ema的帖子

为什么这个C++代码不会出现编译错误?

#include<iostream>
using namespace std;

struct a{
    int e;
    struct abc *d;
};

struct abc{
    int c;
};

int main()
{
 return 0;  
}
Run Code Online (Sandbox Code Playgroud)

我已经定义了我已经声明了结构指针的struct abc后定义.这应该抛出编译错误,因为它在声明之前使用.但是,它没有,为什么?而当我刚刚取代它,而不是,这是给编译错误预期.struct aabcabcstruct abc dstruct abc *d

c++ struct pointers structure

4
推荐指数
2
解决办法
476
查看次数

标签 统计

c++ ×1

pointers ×1

struct ×1

structure ×1