mirror of
https://github.com/ViolentAyang/DataStructureC.git
synced 2026-02-03 10:23:18 +08:00
线性表静态初始化
This commit is contained in:
23
线性表/线性表静态初始化.c
Normal file
23
线性表/线性表静态初始化.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include<stdio.h>
|
||||
#define Maxsize 10
|
||||
|
||||
typedef struct{
|
||||
int data[Maxsize];
|
||||
int length;
|
||||
}SqList;
|
||||
|
||||
void InitList(SqList *L){
|
||||
for(int i = 0;i < Maxsize;i ++ ){
|
||||
L->data[i] = 0;
|
||||
}
|
||||
L->length = 0;
|
||||
}
|
||||
|
||||
int main(){
|
||||
SqList L;
|
||||
InitList(&L);
|
||||
for(int i = 0;i< Maxsize;i++){
|
||||
printf("data[%d]=%d\n",i,L.data[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
BIN
线性表/线性表静态初始化.exe
Normal file
BIN
线性表/线性表静态初始化.exe
Normal file
Binary file not shown.
Reference in New Issue
Block a user