Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <malloc.h>
- typedef unsigned int u32;
- void memorycopy(u32 *from, u32 *to, u32 size);
- int main(){
- int *a = (int *)malloc(sizeof(int));
- int *b = (int *)malloc(sizeof(int));
- *a = 8;
- *b = 5;
- printf("a vale: %i y b vale: %i", *a, *b);
- memorycopy(a, b, sizeof(int));
- printf("\n\n\na vale: %i y b vale: %i", *a, *b);
- getchar();
- return 0;
- }
- void memorycopy(u32 *from, u32 *to, u32 size){
- u32 i;
- for(i = 0; i < size; i++)
- *(u32 *)(to++) = *(u32 *)(from++);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement