Create 静态链表介绍.c

This commit is contained in:
ViolentAyang
2022-03-18 22:16:34 +08:00
committed by GitHub
parent 7fbc2f65d7
commit 377fa36000

View File

@@ -0,0 +1,34 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define MaxSize 10
struct Node{
int data;
int next;
};
typedef struct{
int data;
int next;
}SLinkList[MaxSize];
/*
等价于
struct Node{
int data;
int next;
};
typedef struct NodeSLinkList[MaxSize];
*/
int main(){
//SLinkList a;//等价于 struct Node a[MaxSize];
struct Node x;
printf("sizeX=%d\n",sizeof(x));
struct Node a[MaxSize];
printf("sizeA=%d\n",sizeof(a));
SLinkList b;
printf("sizeB=%d\n",sizeof(b));
return 0;
}