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.
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.
Thanks for sharing this coding.
ReplyDeleteC++ Training | C Language Training | C and C++ institute
Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration.
ReplyDeleteC and C++ Training Institute in chennai | C and C++ Training Institute in anna nagar | C and C++ Training Institute in omr | C and C++ Training Institute in porur | C and C++ Training Institute in tambaram | C and C++ Training Institute in velachery