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
Describe wild pointers in c?
What are multibyte characters?
How do we make a global variable accessible across files? Explain the extern keyword?
What is the heap?
Can a variable be both constant and volatile?
Who invented b language?
What are different types of variables in c?
Explain the use of function toupper() with and example code?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
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!+....
Is linux written in c?
What 'lex' does?
Explain threaded binary trees?
What are variables c?
What are the various types of control structures in programming?