appending int to string in cpp

Solutions on MaxInterview for appending int to string in cpp by the best coders in the world

showing results for - "appending int to string in cpp"
Alessia
20 Oct 2017
1#include <string>     // to use std::string, std::to_string() and "+" operator acting on strings 
2
3int i = 4;
4std::string text = "Player ";
5text += std::to_string(i);
6