String Concatenation in C++
Level 286 keystrokes
Joins two strings and a space with the + operator and prints Hello World.
C++ code
// Stores "Hello" in first1string first = "Hello";// Stores "World" in second2string second = "World";// + on strings creates a new joined string; " " adds the space between the words// first + " " is evaluated first and gives a string, then second is added3cout << first + " " + second << endl;Output
Hello World
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this C++ code and how often they appear.
"× 6<× 4;× 3+× 2=× 2