From d33e765484d6fc72c36093bbcd1492cafa39e818 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Fri, 29 Nov 2024 16:12:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=80=90=E5=AE=9E=E8=B7=B5=E8=AF=BE?= =?UTF-8?q?=E5=86=85=E3=80=9113.=E6=8C=87=E9=92=881/6-4=20=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E5=AD=97=E6=AF=8D.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 【实践课内】13.指针1/6-4 移动字母.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/【实践课内】13.指针1/6-4 移动字母.c b/【实践课内】13.指针1/6-4 移动字母.c index 5ee7705..c859ee2 100644 --- a/【实践课内】13.指针1/6-4 移动字母.c +++ b/【实践课内】13.指针1/6-4 移动字母.c @@ -1,5 +1,6 @@ void Shift(char s[]) { int s_len = strlen(s); memcpy(s + s_len, s, 3); - memcpy(s + 3, s, s_len); + memcpy(s, s + 3, s_len); + s[s_len] = '\0'; }