结构体嵌套外部结构体变量
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef struct student
{
int score
[10];
int data
;
} A
;
struct node
{
int i
;
A P
;
} B
;
int main()
{
return 0;
}
结构体嵌套本身结构体变量--------错误!!
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef struct student
{
int score
[10];
int data
;
} A
;
typedef struct node
{
int i
;
A P
;
struct node l
;
} B
;
int main()
{
return 0;
}
结构体嵌套结构体指针变量本身可以
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef struct student
{
int score
[10];
int data
;
} A
;
typedef struct node
{
int i
;
A P
;
struct node
*next
;
} B
;
int main()
{
return 0;
}
转载请注明原文地址:https://ipadbbs.8miu.com/read-56533.html