📜  cpp 连接方法 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:50.185000             🧑  作者: Mango

代码示例1
string first_name { "Time" };
    string second_name { "Machine" };
    char first_n[100] = { "Hello" };
    char second_n[100] = { "World" };

    // METHOD 1: uses  header
    cout << first_name + second_name << endl;
    // METHOD 2: uses  header
    cout << strcat(first_n, second_n) << endl;
    // METHOD 3: uses  header
    cout << first_name.append(second_name) << endl;