The task should be simple, remove first and last characters.
https://www.codewars.com/kata/56bc28ad5bdaeb48760009b0/train/c
The function gets two parameter (dst
as destination and src
as source), and should return a modified string and assign to dst
pointer (if I understood correctly).
My Answer looks correct to me, but here is my problem:
When the string has more then 9 characters, the modified string comes with some symbols.
char* remove_char(char* dst, const char* src){
memmove(dst,src+1,strlen(src+1)-1);
return dst;
}
Thanks in advance for your help :)