Skip to content

Instantly share code, notes, and snippets.

@Eugeny
Created October 28, 2011 08:52
Show Gist options
  • Save Eugeny/1321900 to your computer and use it in GitHub Desktop.
Save Eugeny/1321900 to your computer and use it in GitHub Desktop.
void *memcpy(void *dest, const void *src, int n) {
// не работает
for (volatile int i = 0; i < n; i++) {
//*(u8int*)((u32int)dest+i) = *(u8int*)((u32int)src+i);
u8int* a = (u8int*)(src+i);
u8int* b = (u8int*)(dest+i);
*b = *a;
}
// работает
u8int* a = (u8int*)(src+4);
u8int* b = (u8int*)(dest+4);
*b = *a;
return dest;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment