What is concatenation ?
Simply,Adding of two string is known as concatenation.
Example-
string_1 is "My"
string_2 is "website"
Then after concatenate both string :
"Mywebsite"
There are many possible ways to do this by C programming either you can direct concate or you can use predefined function that concate two string.
program:
#include< iostream>
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;
//Find length of first string
while(ch1[i++]!='')
len++;
//Now concate second string in first string
i=0;
while(ch2[i]!='')
{
ch1[len+i]=ch2[i];
i++;
}
ch1[len+i]='';
cout<<"Now first string is "<< ch1;
}
Enter first string
My_program
Enter second string
_is_correct
Now first string is My_program_is_correct