Answers for "c++ append number to string"

C++
0

appending int to string in cpp

#include <string>     // to use std::string, std::to_string() and "+" operator acting on strings 

int i = 4;
std::string text = "Player ";
text += std::to_string(i);
Posted by: Guest on August-21-2021

Browse Popular Code Answers by Language