程序错误warning C4047: 'function' : 'char *' differs in levels of indirection from 'char '0
Mr.HyukHae2014.12.20浏览660次分享举报
#include"stdio.h" /*引用库函数*/
#include"stdlib.h"
#include"ctype.h"
#include"string.h"
#define NULL 0
typedef struct student{
char num[11];
char name[20];
char sex[20];
char age[3];
char home[20];
struct student *next;
} student,*stulist;
void Numsort(stulist *h,int n) /*按学号排序*/
{
int i,j;
stulist p,q;
char t;
p=(*h)->next;q=p->next;
for(i=0;i
for(j=0;j
if(strcmp(p->num,q->num)>0)
{
strcpy(t,q->num); //错误指在这一行
strcpy(q->num,p->num);
strcpy(p->num,t);
strcpy(t,q->name);
strcpy(q->name,p->name);
strcpy(p->nume,t);
strcpy(t,q->sex);
strcpy(q->sex,p->sex);
strcpy(p->sex,t);
strcpy(q->age,p->age);
strcpy(p->age,t);
strcpy(q->home,p->home);
strcpy(p->home,t);
p=q;q=q->next;
}
}
main()
{
stulist l;
int flag=1; char ch;
InitList(&l);
while (flag)
{ menu();
ch=getchar();
switch (ch) {
case '1': Input(&l); //增加记录
system("pause");
break;
case '3': Numsort(l); //按学号排序
system("pause");
}
system("cls");
}
}
求帮忙,找了一个小时的错了TAT。还有初始化空表和输入数据因为字数限制没发