Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main (int argc, char **argv){
- char arr[]="0123456789";
- printf("%s\n",arr);
- //overlapping memory blocks
- memmove(arr, arr+2, 8);
- printf("%s\n",arr);
- return 0;
- }
- /*
- output:
- 0123456789
- 2345678989
- */
Advertisement
Add Comment
Please, Sign In to add comment