memcpy : memcpy « string.h « C Tutorial






ItemValue
Header filestring.h
Declarationvoid *memcpy(void *to, const void *from, size_t count);
Functioncopies count characters from *from into *to.
Returnreturns *to.


#include <stdio.h>
  #include <string.h>

  #define SIZE 80

  int main(void)
  {
    char buf1[SIZE], buf2[SIZE];

    strcpy(buf1, "When, in the course of...");
    memcpy(buf2, buf1, SIZE);
    printf(buf2);

    return 0;
  }
When, in the course of...








24.3.memcpy
24.3.1.memcpy