From 2d99fe1c7e5f901b62ce4ff536cfa50fa45b9f7d Mon Sep 17 00:00:00 2001 From: Jdhggg <24016020834@stu.nsu.edu.cn> Date: Mon, 17 Mar 2025 16:29:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A0=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sq插入函数位置不对 --- Project2/Debug/Project2.log | 5 ++--- .../Debug/Project2.tlog/CL.command.1.tlog | Bin 2190 -> 2190 bytes Project2/Debug/Project2.tlog/CL.read.1.tlog | Bin 10650 -> 10650 bytes Project2/Debug/Project2.tlog/CL.write.1.tlog | Bin 2130 -> 2130 bytes sq_list.c | 4 ++-- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Project2/Debug/Project2.log b/Project2/Debug/Project2.log index cd8193c..10bca46 100644 --- a/Project2/Debug/Project2.log +++ b/Project2/Debug/Project2.log @@ -1,4 +1,3 @@ - main.c -C:\code\lencode\Project2\main.c(9,34): warning C4047: “函数”:“sq_list *”与“sq_list **”的间接级别不同 -C:\code\lencode\Project2\main.c(9,34): warning C4024: “init_sq_list”: 形参和实参 1 的类型不同 + sq_list.c +C:\code\lencode\Project2\sq_list.c(10,1): warning C4716: “init_sq_list”: 必须返回一个值 Project2.vcxproj -> C:\code\lencode\Project2\Debug\Project2.exe diff --git a/Project2/Debug/Project2.tlog/CL.command.1.tlog b/Project2/Debug/Project2.tlog/CL.command.1.tlog index ce6de68021b9ee21902090c69b17752da7011161..9ca4aac48986ba7ddbb4b63363ce9a305b2317ae 100644 GIT binary patch delta 21 ccmeAZ>=WD|$2_@?Ltrx-TL;tTS4=mU07?%A`v3p{ delta 17 ZcmeAZ>=WD|$GrI!>k_8Tub9p-0RTGp2E_mX diff --git a/Project2/Debug/Project2.tlog/CL.read.1.tlog b/Project2/Debug/Project2.tlog/CL.read.1.tlog index 10b84e4a78efe30b509dd81a8c43fc2cd1eb313b..d321be297d4dd37a10b8cca16f8e596cbea8f1cc 100644 GIT binary patch delta 17 YcmbOgJS%uZ3D;&7sWSe}4qO}f0X~ZcI{*Lx delta 17 YcmbOgJS%uZ3D;&hsT%&x4qU7F0X}mEH2?qr diff --git a/Project2/Debug/Project2.tlog/CL.write.1.tlog b/Project2/Debug/Project2.tlog/CL.write.1.tlog index 2d403bc8681d021ee4ccefd1a21864c18b2b85c2..d4dd94b717a29cfc0ff32c5f8fb34cdd10d72dac 100644 GIT binary patch delta 20 ccmca4a7kdpB-YJB><)~R@3EO|Ec0Om08*+4H~;_u delta 16 Ycmca4a7kdpB-V{(4UC&7u{tmU06gjjKL7v# diff --git a/sq_list.c b/sq_list.c index 9325888..731f6b8 100644 --- a/sq_list.c +++ b/sq_list.c @@ -54,9 +54,9 @@ void insert_sq_list(sq_list* list, int pos, int value) printf("\n"); if (pos > list->length && pos <= MAX) printf("ڴ˴"); - int i = list->length; + int i = list->length -1; int flog = i; - for (i; i > pos; i--) + for (i; i >= pos-1; i--) { list->data[i + 1] = list->data[i]; }