c++ string concatenation
string first_name = "foo"
string last_name = "bar"
std::cout << first_name + " " + last_name << std::endl;
c++ string concatenation
string first_name = "foo"
string last_name = "bar"
std::cout << first_name + " " + last_name << std::endl;
cpp concatenate methods
string first_name { "Time" };
string second_name { "Machine" };
char first_n[100] = { "Hello" };
char second_n[100] = { "World" };
// METHOD 1: uses <string> header
cout << first_name + second_name << endl;
// METHOD 2: uses <cstring> header
cout << strcat(first_n, second_n) << endl;
// METHOD 3: uses <string> header
cout << first_name.append(second_name) << endl;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us