70,036
社区成员
发帖
与我相关
我的任务
分享
int main()
{
struct student *p1,*p2;
p1=p2=(struct student*)malloc(sizeof(struct student));
scanf("%d %d",&(*p1).num,&(*p1).score);
scanf("%d %d",&(*p2).num,&(*p2).score);
swap(p1,p2);
printf("第一位学生成绩%d %d",(*p1).num,(*p1).score);
printf("第二位学生成绩%d %d",(*p2).num,(*p2).score);
}不知道是不是我这主函数参数传的不对呢?