← From C to C++: What's New

String Greeting

medium

Read a name and print a greeting built by concatenating string pieces with +, in the exact form Hello, Ada! Welcome.

Compare this to how much bookkeeping strcat needed in Module 2 – a correctly-sized destination buffer declared up front, strcat never checking whether it actually fit. std::string’s + handles all of that internally; you just describe the string you want.

Your solution

"Run" uses the sample stdin ("Ada"). "Submit" checks your code against all 3 test cases.

Test results

Submit your solution to run it against all test cases.

Hints

    Reference solution