主函数应该如何添加代码?
#include "stdafx.h"#include "stdio.h"
#include "stdlib.h"
#define OK 1
#define NULL 0
#define OVERFLOW -2
typedef int ElemType;
typedef int Status;
#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10
typedef struct node
{
int data;
struct node *next;
}Linklist;
Status Initilist()
{
Linklist *head;
if(head=(Linklist *)malloc(sizeof(node)==NULL))
{
return 0;
}
head->next=NULL;
return OK;
}
Linklist *createlist(int n)
{
int x,k;
Linklist *head,*r,*p;
p=(Linklist *)malloc(sizeof(Linklist));
head=p;
p->next=NULL;
r=p;
for(k=1;k<=n;k++)
{
printf("input value:\n");
scanf("%d",&x);
p->data=x;
p->next=NULL;
r->next=p;
r=r->next;
}
return (head);
}
Linklist *find(int i)
{
Linklist *head;
int j;
Linklist *p;
p=head->next;
j=1;
while(p!=NULL&&j<i)
{
p=p->next;
j++;
}
return p;
}
void insert(Linklist *head,int x,int k)
{
Linklist *p,*s,*r;
s=(Linklist *)malloc(sizeof(Linklist));
s->data=x;
p=head->next;
if(p==NULL)
{
head->next=s;
s->next=NULL;
}
else
{
while(p&&p->data!=k)
{
p=p->next;
}
if(p->data==k)
{
s->next=p->next;
p->next=s;
}
else
{
p->next=r;
r->next=NULL;
}
}
}
int main(int argc, char* argv[])//主函数应该如何添加代码实现上面函数的功能?
{
Linklist L;
Linklist *head;
int select;
int i=0;
Initilist();
return 0;
}