Concat two string with most overlapped substring has to
remove "abcd"+ "cdef" = "abcdef
Answer Posted / sham
char *strappend1(char *src,char *des)
{
char *tmp=src;
int f=0;
while(*des)
{
while(*src!='\0')
{
if(*src==*des)
{
f=0;
break;
}
else
f=1;
src++;
}
if(f==1)
{
*src++=*des;
*src='\0';
}
des++;
}
return tmp;
}
int main(int argc,char **argv)
{
char *src=argv[1],*des=argv[2];
char *str;
str=strappend1(src,des);
printf("%s",str);
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Explain the bubble sort algorithm.
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
How do I read the arrow keys? What about function keys?
what is the syallabus of computer science students in group- 1?
What is character set?
There seem to be a few missing operators ..
Which is better pointer or array?
What does a pointer variable always consist of?
Are there any problems with performing mathematical operations on different variable types?
Explain null pointer.
Why cant I open a file by its explicit path?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
What is property type c?
Why is this loop always executing once?
What does the characters “r” and “w” mean when writing programs that will make use of files?