INT to STR

From: Marcel (neegeenspam_at_hotentottententententoonstellingen.nl)
Date: 11/05/03


Date: Wed, 5 Nov 2003 11:59:24 +0100

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