mirror of
https://github.com/happyflyer/wangdao-data-structure.git
synced 2026-04-30 21:51:39 +08:00
完成双链表、循环链表、静态链表
This commit is contained in:
24
ch2/static-link/with.cpp
Normal file
24
ch2/static-link/with.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define MaxSize 10
|
||||
struct Node
|
||||
{
|
||||
int data;
|
||||
int next;
|
||||
};
|
||||
typedef struct
|
||||
{
|
||||
int data;
|
||||
int next;
|
||||
} SLinkList[MaxSize];
|
||||
|
||||
int main()
|
||||
{
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user