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


Please Help Members By Posting Answers For Below Questions

Describe wild pointers in c?

831


What are multibyte characters?

836


How do we make a global variable accessible across files? Explain the extern keyword?

1612


What is the heap?

943


Can a variable be both constant and volatile?

801


Who invented b language?

1133


What are different types of variables in c?

755


Explain the use of function toupper() with and example code?

841


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

813


the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....

23062


Is linux written in c?

784


What 'lex' does?

919


Explain threaded binary trees?

889


What are variables c?

805


What are the various types of control structures in programming?

800