1
/
23
#include
#include
#include
int
saveflag=0;
/*
单链表内容有无发生改变,是否需要存盘的标志
变量
*/
structemployee
{
charnum[10];
/*
工号
*/
charname[15];
/*
姓名
*/
charsex[7];
/*
性别
*/
intage;
/*
年龄
*/
chareducation[15];
/*
学历
*/
intsalary;
/*
工资
*/
charphone[20];
/*
电话号码
*/
charaddress[30];
/*
住址
*/
};
typedefstructNode
{
structemployeedata;
structNode*next;
}ListNode,*LinkList;
voidInitList(LinkList*head)
/*
将单链表初始化为空。
动态生成一个头结点,
并
将头结点的指针域置为空
*/
{
if((*head=(LinkList)malloc(sizeof(ListNode)))==NULL)
/*
为头结点分配一
个存储空间
*/
printf("
系统分配存储空间失败!
\n");
exit(-1);
(*head)->next=NULL;
/*
将头结点的指针域置为空
*/
}
ListNode*Locatenum(LinkListhead,charfind[])
//
通过职工工号查找,
返回定
位指针。
{
LinkListp;