Mega Code Archive

 
Categories / C / Code Snippets
 

Memory copy

#include <stdio.h> #include <string.h> #define SIZE 100 int main(void) { char buf1[SIZE], buf2[SIZE]; strcpy(buf1, "I Love Clementine"); memcpy(buf2, buf1, SIZE); printf(buf2); return 0; }