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
Why do we use return in c?
What is a 'null pointer assignment' error?
diff between exptected result and requirement?
what are the different storage classes in c?
What is #line?
hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel
What is the difference between text and binary i/o?
Write a program for finding factorial of a number.
Why C language is a procedural language?
What is the full form of getch?
What are header files and explain what are its uses in c programming?
What do you mean by a local block?
Why should I prototype a function?
What is a structure and why it is used?
Where static variables are stored in memory in c?