INT to STR
From: Marcel (neegeenspam_at_hotentottententententoonstellingen.nl)
Date: 11/05/03
- Next message: keanu: "Re: INT to STR"
- Previous message: Marc Ferry: "Re: Different C++ compiler exec. sizes"
- Next in thread: keanu: "Re: INT to STR"
- Reply: keanu: "Re: INT to STR"
- Reply: red floyd: "Re: INT to STR"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: keanu: "Re: INT to STR"
- Previous message: Marc Ferry: "Re: Different C++ compiler exec. sizes"
- Next in thread: keanu: "Re: INT to STR"
- Reply: keanu: "Re: INT to STR"
- Reply: red floyd: "Re: INT to STR"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|