diff options
author | haturatu <taro@eyes4you.org> | 2024-12-12 19:39:56 +0900 |
---|---|---|
committer | haturatu <taro@eyes4you.org> | 2024-12-12 19:39:56 +0900 |
commit | 9ed0c06de64b7bd6f5390c4f5972ac0578c0f858 (patch) | |
tree | 6ad61ca8f1f5a4375620313bf863a95d232d6a66 /memmove.c | |
parent | 1d810e685c5d97426bf6fe07d879a8cddd7b5743 (diff) |
wip
Diffstat (limited to 'memmove.c')
-rw-r--r-- | memmove.c | 19 |
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"); + } +} |