Blogger Tips And Tricks|Latest Tips For Bloggers Free Backlinks

Sunday 18 November 2012

Write a program to memory move memmove() function in C language examples?

memmove(),memory move,memmove() function, memory move function,memmove() in C,memory move in C,program to memory move function,program to memmove() function,Write a program to memory move memmove() function in C language,memmove() in c language




 memmove() function

                   It copies the number of bytes from located pointed of source and it again copied into the located point of destination,In this case,the overlap will be occurring in the destination. i.e memmove() function.

syntax
              void *memmove(void *destination,void *source,size_t count);

 Program
            
                 #include<stdio.h>
                 main()
                 {
                       char str[] = "Programming";
             
                            memmove(str+1,str+3,4);

                     printf("After memory move  : %s\n",str);
                  }

    Output
                  After memory move :Pgramamaing

         Explanation 
                                 a[0]   1   2   3   4   5   6   7   8   9   10
                                   P     r    o   g    r    a   m  m   i   n     g
                    In memmove(str+1,str+3,4) function,from a[3] position to 4 bytes (a[6]) are copied and overlapped in destination string.So output is Pgramamaing. 

            

2 comments: