C++ 2 string variable concatenation

C++ 2 string variable concatenation

June 27, 2024·İbrahim Korucuoğlu
İbrahim Korucuoğlu

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;
}
Last updated on