Skip to content

Instantly share code, notes, and snippets.

@gtke
Created December 12, 2013 03:17
Show Gist options
  • Select an option

  • Save gtke/7922714 to your computer and use it in GitHub Desktop.

Select an option

Save gtke/7922714 to your computer and use it in GitHub Desktop.
memcpy
void memcopy(void *dest, void *src, size_t size){
void *temp = malloc(size);
int i;
for(i=0; i<size; i++){
*((char*)temp+i) = *((char*)src+i);
}
for(i=0; i<size; i++){
*((char*)dest+i) = *((char*)temp+i);
}
free(temp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment