From 1f5e4889bac1671e353ac493130147515de56a6a Mon Sep 17 00:00:00 2001 From: fourish Date: Mon, 23 Dec 2024 00:05:16 +0800 Subject: [PATCH] [FIX] Fixed wrong type of parameters passed in when calling scanf in Insert function --- ...250\344\270\216\347\273\223\346\236\204\344\275\223.c" | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git "a/\347\250\213\345\272\217\350\256\276\350\256\2417\351\223\276\350\241\250\344\270\216\347\273\223\346\236\204\344\275\223.c" "b/\347\250\213\345\272\217\350\256\276\350\256\2417\351\223\276\350\241\250\344\270\216\347\273\223\346\236\204\344\275\223.c" index 3e76993..fdebed3 100644 --- "a/\347\250\213\345\272\217\350\256\276\350\256\2417\351\223\276\350\241\250\344\270\216\347\273\223\346\236\204\344\275\223.c" +++ "b/\347\250\213\345\272\217\350\256\276\350\256\2417\351\223\276\350\241\250\344\270\216\347\273\223\346\236\204\344\275\223.c" @@ -56,13 +56,13 @@ void Insert(int n)//插入新的学生信息 struct stu_info* p1, * p2 = head, * p3 = head; p1 = (struct stu_info*)malloc(sizeof(struct stu_info)); printf("输入学号(最多9数字):"); - scanf("%9s", &(*p1).stu_num); + scanf("%9s", p1->stu_num); printf("输入姓名(最多7字符):"); - scanf("%7s", &(*p1).stu_name); + scanf("%7s", p1->stu_name); printf("输入性别(最多1字符,M男,F女):"); - scanf("%1s", &(*p1).stu_sex); + scanf("%1s", p1->stu_sex); printf("输入成绩:"); - scanf("%d", &(*p1).stu_score); + scanf("%d", &p1->stu_score); if (n == 0) { (*p1).next = head;