Techiio-author
Started by Anik AdhikaryMay 4, 2022

Closed
How to Write a programe in C++ to Combine the two strings?

7 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 7 VIEWES SHARE

anyone please help me to do this problem......

3 Replies

Techiio-commentatorSidhdarth Basu replied 13 days ago0 likes0 dislikes
#include <iostream>
 using namespace std;
int main()
{
string s1, s2, result;
cout << "Enter string s1: ": getline (cin, s1);
cout << "Enter string 52: getline (cin, s2);
result = s1 + s2;
cout << "Resultant String = "<< result:
return 0;
}
Techiio-commentatorNurjaman Shekh replied 13 days ago0 likes0 dislikes

Please check your code.

There are various ways to concatenate strings.

Method 1: Using strcat() function.

Method 2: Using append() function.

Method 3: Using ‘+’ Operator

Techiio-commentatorAnik Adhikary replied 12 days ago0 likes0 dislikes

Great, it's working now:) . . Thanks for ur advice...

This thread is closed by Anik Adhikary
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance