Memory copy : Memory Copy « Memory « C / ANSI-C






Memory copy

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

#define SIZE 80

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

  strcpy(buf1, "Hiiiiiiiiiiiiiiiiiiii...");
  memcpy(buf2, buf1, SIZE);
  printf(buf2);

  return 0;
}


           
       








Related examples in the same category

1.Copy bytes to buffer from buffer: how to use memcpyCopy bytes to buffer from buffer: how to use memcpy