-
Notifications
You must be signed in to change notification settings - Fork 0
/
List_Test.c
42 lines (40 loc) · 868 Bytes
/
List_Test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* =====================================================================================
*
* Filename: List_Test.c
*
* Description:
*
* Version: 1.0
* Created: 11/29/2014 04:05:08 PM
* Revision: none
* Compiler: gcc
*
* Author: 张世龙 (mn), [email protected]
* Company: free
*
* =====================================================================================
*/
#include "Public.h"
#include "List.h"
int main()
{
LinkList list = NULL;
InitList(&list);
for(int i=1;i<10;++i){
ListInsert(list,i,&i);
}
for(int i=1;i<=list->data;++i){
int tmp ;
GetElem(list,i,&tmp);
printf("第%d个元素是%d\n",i,tmp);
}
int ret;
ListDelete(list,2,&ret);
for(int i=1;i<=list->data;++i){
int tmp ;
GetElem(list,i,&tmp);
printf("第%d个元素是%d\n",i,tmp);
}
return 0;
}