the code above strips backslashes but I do not understand how it is done from code, it seems to me that the code increases the address each time in the loop and copies the string from the succeeding address to the current address, how does this strip backslashes?
it finds it, on line 8, and when it does (the if statement is true) it copies the back half of the string over the current part.
for example:
blahblah \\ whatever
finds the \ and the \ [0] and [1]
then it copies " whatever" over the first backslash.
if it removed any, it returns true.
this is C code; c++ would use string which has a way to do this for you.
it may be more efficient to use strstr to find the pattern if you are writing C.
its not that bad. It can probably be faster, but its not 'that' inefficient. Change it for strstr and call it good, unless you are absolutely sure it is a bottleneck for performance.
To avoid overflows, the size of the array pointed by destination shall be long enough to contain the same C string as source (including the terminating null character), and should not overlap in memory with source.
memmove is safe if you are in C and need to overlap the memory. I think most compilers work if you overlap strcpy but they are correct, it isnt ensured and is unsafe to assume.
The C library function void *memmove(void *str1, const void *str2, size_t n) copies n characters from str2 to str1, but for overlapping memory blocks, memmove() is a safer approach than memcpy().