M
Marcel
The small code underneath is displaying the text 'hello2' as output. I
supposed it to display hello50. I think i will have to convert the int to a
string or am i wrong? If so, what is the right command? Sorry i am a
beginner....
Thanks in advance!
#include <iostream>
#include <string>
int main() {
int red = 50;
std::string temp = "";
temp += "hello";
temp += red;
std::cout << temp;
std::cin.get();
return 0;
}
Regards,
Marcel
supposed it to display hello50. I think i will have to convert the int to a
string or am i wrong? If so, what is the right command? Sorry i am a
beginner....
Thanks in advance!
#include <iostream>
#include <string>
int main() {
int red = 50;
std::string temp = "";
temp += "hello";
temp += red;
std::cout << temp;
std::cin.get();
return 0;
}
Regards,
Marcel