CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

String Concatenation with to_string

C++ code walkthrough · Question 29
mediumStrings

Code

Read carefully. What does this print?
1#include <iostream>
2#include <string>
3using namespace std;
4int main() {
5 string s = "Score";
6 int n = 42;
7 cout << s + ": " + to_string(n) << endl;
8 return 0;
9}

Your answer