RicardasSim

memmove

Jan 7th, 2019
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main (int argc, char **argv){
  6.  
  7.     char arr[]="0123456789";
  8.  
  9.     printf("%s\n",arr);
  10.    
  11.     //overlapping memory blocks
  12.     memmove(arr, arr+2, 8);
  13.    
  14.     printf("%s\n",arr);
  15.    
  16. return 0;
  17. }
  18.  
  19. /*
  20. output:
  21.  
  22. 0123456789
  23. 2345678989
  24.  
  25.  */
Advertisement
Add Comment
Please, Sign In to add comment