#include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
#define NULL 0
#define LEN sizeof(struct txlproject)
int n;
struct txlproject
{
char name[30];
char work[30];
char handset[30];
char email[30];
char address[30];
struct txlproject *next;
};
struct txlproject *shifang(struct txlproject *head); // 释放内存函数声明
///////////////
struct txlproject *creat(void)
{
struct txlproject *head,*p1,*p2;
char name[20];
n=0;
p1=(struct txlproject *)malloc(LEN);
p2=p1;
printf("请输入通讯录的内容!\n姓名输入为0时表示创建完毕!\n");
printf("请输入姓名:"); gets(name);
if(strcmp(name,"0")!=0)
{
}
else
{
}
}
/////////////////
void print(struct txlproject *head)
{
struct txlproject *p;
if(head!=NULL)
{
}
else
}
////////////////////
struct txlproject *insert(struct txlproject *head)
{
struct txlproject *p0,*p1,*p2;
char name[20];
p1=head;
printf("请输入增加的内容:\n");
printf("请输入姓名:"); gets(name);
if(strcmp(name,"0")==0)
{
}
else
{
}
}
////////////////
struct txlproject *xianshi(struct txlproject *head)
{
struct txlproject *p1,*p2;
char name[30];
int m;
if(head==NULL)
{
}
p1=head;
m=0;
printf("请输入需要显示人的姓名:");
gets(name);
while(p1!=NULL)
{
}
{
}
return(head);
}
///////////////
struct txlproject *paixu(struct txlproject *head)
{
struct txlproject *p1,*p2;
int i,j;
struct txlproject1
{
};
struct txlproject1 px[200];
struct txlproject1 temp;
if(head==NULL)
{
}
p1=head;
for(i=0;i<n,p1!=NULL;i++)
{
}
for(j=0;j<n-1;j++)
{
}
p1=(struct txlproject *)malloc(LEN);
p2=p1;
strcpy(p1->name,px[0].name);
strcpy(p1->work,px[0].work);
strcpy(p1->handset,px[0].handset);
strcpy(p1->email,px[0].email);
strcpy(p1->address,px[0].address);
head=p1;
for(i=1;i<n;i++)
{
}
p2->next=NULL;
printf("按姓名排序后为:\n");
print(head);
return(head);
}
/////////////
struct txlproject *chazhao(struct txlproject *head)
{
p1=head;
printf("********************\n");
printf("**
printf("********************\n");
m=0;
gets(name);
return(head);
}
/////////////
struct txlproject *shifang(struct txlproject *head)
{
struct txlproject *p1;
while(head!=NULL)
{
}
return(head);
}
/////////////
void save(struct txlproject *head)
{
FILE *fp;
struct txlproject *p1;
char tong[30];
if(head==NULL)
{
}
printf("请输入保存后的文件名:");
gets(tong);
fp=fopen("(tong).txt","w");
if(fp==NULL)
{
}
p1=head;
fprintf(fp,"姓名
for(;p1!=NULL;)
{
}
printf("保存完毕!\n");
fclose(fp);
}
////////////////
struct txlproject *load(struct txlproject *head)
{
FILE *fp;
char tong[30];
struct txlproject *p1,*p2;
printf("请输入要输出的文件名:");
gets(tong);
fp=fopen("(tong).txt","r");
if(fp==NULL)
{
}
else
{
}
p1=(struct txlproject *)malloc(LEN);
fscanf(fp,"%s%s%s%s%s",&p1->name,&p1->work,&p1->handset,&p1->email,&p1->address);
if(feof(fp)!=0)
{
}
else
{
}
fclose(fp);
}
/////////////
struct txlproject *zonghe(struct txlproject *head)
{
char num[10];
while(1)
{
}
return(head);
}
////////////////
void main()
{
struct txlproject *head;
head=NULL;
char num[10];
printf("*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n");
printf("*=*
printf("*=* 请及时保存创建完毕的通讯录内容!
printf("*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*\n");
while(1)
{
}
}