use of strcat() function:
-This function are used to concate two string.
Syntax-
strcat(string1,string2)
-Result is stored in string1.
Example-
string1 is "My"
string2 is "Website"
After concatenation : "MyWebsite"
program:
#include< iostream>
#include< string.h>
int main()
{
char ch1[20],ch2[20];
int i=0,len=0;
//input of string
cout<<"Enter first string"<< endl;
cin>>ch1;
cout<<"Enter second string"<< endl;
cin>>ch2;
strcat(ch1,ch2);
cout<<"Now first string is "<< ch1;
}
Enter first string
Myprogram
Enter second string
_isgood
Now first string is Myprogram_isgood