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 void pointer?
What’s the special use of UNIONS?
What is && in c programming?
What is difference between structure and union with example?
What are pointers? What are different types of pointers?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is methods in c?
What are volatile variables in c?
How do I get an accurate error status return from system on ms-dos?
Can you add pointers together? Why would you?
In c programming language, how many parameters can be passed to a function ?
what is ur strangth & weekness
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Write a program on swapping (100, 50)
What is auto keyword in c?