-
int to string
hey guys long time no see been making games, but im back now :P
i need to figure out how to convert an int to a string (dony ask why, long story) but i really need to figure it out
ive tried stuff like
int a =5;
string b;
b = (int)a;
but no cigar
thnx
-
use stringstream class
Code:
int n = 123;
std::string s;
std::stringstream str;
str << n;
s = str.str();
-
-
-
tnx and congrats to your 200th post :D
-
Thank goodness the art of game development never requires one to convert an integer value to a string!!
:cool:
-
i need it for my game to calculate FPS so yes thts why i asked :P