#include #include int main() { char src[]=\"123456\"; strcpy(src, &src[1]); printf(\"Final copied string : %s\\n\", sr
This is undefined behaviour. Use the memmove function instead. memmove is designed to allow overlapping of source and destination buffers.
memmove
memmove(src, &src[1], strlen(&src[1]) + 1) ; // + 1 for copying the terminating zero