Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to find out the union of two character arrays?

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


Please Help Members By Posting Answers For Below Questions

Write a program which returns the first non repetitive character in the string?

1073


What is void main ()?

1033


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

1168


Why n++ execute faster than n+1 ?

2882


What is a macro?

1059


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

2257


explain what are pointers?

978


Write a program to know whether the input number is an armstrong number.

1085


Explain what is page thrashing?

1060


Write a Program to accept different goods with the number, price and date of purchase and display them

6171


What is the difference between c &c++?

1105


Why pointers are used in c?

964


Explain modulus operator.

1014


Where does the name "C" come from, anyway?

1098


How to find a missed value, if you want to store 100 values in a 99 sized array?

1376