summaryrefslogtreecommitdiff
path: root/memmove.c
blob: f766ad0d50af40150c277935d538b484f969208c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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");
  }
}