void addemp_1(LinkList& L)//录入员工信息
{
LNode* q1, * s;
q1 = s = L;
char name[90], phone[90], xb[90], nl[90];
int bianhao;
FILE* p1;
errno_t error;
error = fopen_s( &p1 ,"员工信息.txt", "w");
while (fscanf_s(p1, "%d %s %s %s %s", &bianhao, name, xb, nl, phone) != EOF)
{
q1 = (LinkList)malloc(sizeof(LNode));
strcpy_s(q1->name, name);
strcpy_s(q1->phone, phone);
strcpy_s(q1->xb, xb);
strcpy_s(q1->nl, nl);
q1->bianhao = bianhao;
s->next = q1;
s = q1;
}
s->next = NULL;
fclose(p1);
}
后面改"w+",追加修改文件