Answer Posted / prakashdasari
char *str1,*str2,*res;
while(*str1!=NULL)
str++;
while(*str2!=NULL)
{
*str1 == *str2;
str1++;
str2++;
}
*str1 = '\0';
//so total string is in one string ie str1 itself;
//now i will remove duplicates from entire string
for(i=0;str[i]!=NULL;i++)
{
for(j=0;str[j]!=NULL;j++)
{
if(str[i]==str[j])
{
flag = 1;break;
}
else flag = 0;
}
if(flag == 0)
{
*res = str[i];
res++;
}
*res = '\0';
}
now resultant string (res) is union of two character
arrays....
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
What are header files in c?
How arrays can be passed to a user defined function
Which are low level languages?
explain what are pointers?
Tell us bitwise shift operators?
What are the disadvantages of external storage class?
Differentiate between calloc and malloc.
What does %p mean c?
Are bit fields portable?
Why does everyone say not to use gets?
How old is c programming language?
Explain union.
Where register variables are stored in c?
Can you apply link and association interchangeably?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array