Concatenate strings - C++ Program

Q. Write a C++ program to concatenate one string to another string.


Following program is concatenating one string to another string using strcat() library function.

using namespace std;
int main()
        char str1[50], str2[50];
        cout<<"\n Enter First String : ";
        cout<<"\n Enter Second String : ";
        strcat(str1, str2);
        cout<<"\n String After Concatenation is : "<<str1;
        return 0;


concate string