From 9ed0c06de64b7bd6f5390c4f5972ac0578c0f858 Mon Sep 17 00:00:00 2001 From: haturatu Date: Thu, 12 Dec 2024 19:39:56 +0900 Subject: wip --- memmove.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 memmove.c (limited to 'memmove.c') diff --git a/memmove.c b/memmove.c new file mode 100644 index 0000000..f766ad0 --- /dev/null +++ b/memmove.c @@ -0,0 +1,19 @@ +#include +#include + +int main() +{ + char str[20] = "abc,def"; + + printf("memmove()実行前\n"); + printf("%s\n", str); + /// => abc,def + + if (memmove(str+4, str, strlen(str))) { + printf("memmove()実行後\n"); + printf("%s\n", str); + // => abc,abc,def + } else { + fprintf(stderr, "エラー発生\n"); + } +} -- cgit v1.2.3