summaryrefslogtreecommitdiff
path: root/memmove.c
diff options
context:
space:
mode:
authorhaturatu <taro@eyes4you.org>2024-12-12 19:39:56 +0900
committerhaturatu <taro@eyes4you.org>2024-12-12 19:39:56 +0900
commit9ed0c06de64b7bd6f5390c4f5972ac0578c0f858 (patch)
tree6ad61ca8f1f5a4375620313bf863a95d232d6a66 /memmove.c
parent1d810e685c5d97426bf6fe07d879a8cddd7b5743 (diff)
wip
Diffstat (limited to 'memmove.c')
-rw-r--r--memmove.c19
1 files changed, 19 insertions, 0 deletions
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 <stdio.h>
+#include <string.h>
+
+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");
+ }
+}