C Tutorial/string.h/memmove

Материал из C\C++ эксперт
Перейти к: навигация, поиск

memmove

Item Value Header file string.h Declaration void *memmove(void *to, const void *from, size_t count); Function moves count characters from *from into *to. Return returns *to.


<source lang="cpp">#include <stdio.h>

 #include <string.h>
 #define SIZE 80
 int main(void)
 {
   char str[SIZE], *p;
   strcpy(str, "AAAAAAAAAAAAAAAAAAAAAAAAA");
   p = str + 10;
   memmove(str, p, SIZE);
   printf("result after shift: %s", str);
   return 0;
 }</source>