C++ 2 string variable concatenation
In this article, we show an example of combining 2 string variables.

Categories:
less than a minute
In this article, we show an example of combining 2 string variables.
#include <iostream>
#include <string>
int main() {
std::string firstString = "prs";
std::string secondString = "def";
std::string result;
result = firstString + secondString;
std::cout << result << std::endl;
return 0;
}
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.