How to concatenate two strings in C++
In this post we will give you information about How to concatenate two strings in C++. Hear we will give you detail about How to concatenate two strings in C++And how to use it also give you demo for it if it is necessary.
we are going to learn about how to concatenate the two strings in C++.
Concatenation means the joining of two strings into a single string.
To concatenate the two strings into a single string, we can use the + operator in C++.
Here is an example:
string a = "Welcome ";string b = "John";string c = a + b;cout << c;
Output:
Welcome John
Similarly, we can use the built-in append() function in C++ to concatenate strings.
string a = "Welcome ";string b = "John";string c = a.append(b);cout << c;
Output:
Welcome John
Hope this code and post will helped you for implement How to concatenate two strings in C++. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs
