Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
Source by www.journaldev.com #
 
PREVIOUS NEXT
Tagged: #cpp #concatenate #methods
ADD COMMENT
Topic
Name
2+9 =