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
What is cohesion and coupling in c?
What is the scope of static variable in c?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
How can a program be made to print the line number where an error occurs?
What does %p mean c?
What is union and structure?
What is variable declaration and definition in c?
What is #pragma statements?
When should structures be passed by values or by references?
What is #include stdio h and #include conio h?
Explain can you assign a different address to an array tag?
What is the use of the function in c?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)
Why is c still so popular?
What is a stream in c programming?