为什么不允许声明具有自己的标识符的结构作为其元素?作为一个自引用结构,由结构的同一个变量用指针符号声明!
这是我试过的代码:
#include<stdio.h>
#include<conio.h>
struct am
{
int a;
struct am k; // this reported an error
};
Run Code Online (Sandbox Code Playgroud)
这段代码报告了一个错误,当我用它作为指针接受它时,我搜索了网络,我开始知道它被称为自引用结构
#include<stdio.h>
#include<conio.h>
struct ko
{
int a;
struct ko * op; // this was allowed by my compiler
};
Run Code Online (Sandbox Code Playgroud)
这个结构工作请告诉我!
我正在使用borland international inc的TurboC++ 3.0版.