How can i concatinate in c++ to give a sentence | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can i concatinate in c++ to give a sentence

21st Apr 2018, 4:27 PM
Ayobami
2 Answers
+ 16
std::string name = "dt"; int age = 20; std::string res; res = name + std::to_string(age);
21st Apr 2018, 4:35 PM
๐ŸŒ›DT๐ŸŒœ
๐ŸŒ›DT๐ŸŒœ - avatar
+ 2
Just add the 2 strings with +.
21st Apr 2018, 5:31 PM
Timon PaรŸlick