Geralds Mod
May 15th, 2008, 09:36 PM
Is it possible to do this?
I have tried something like this but it has not worked:
float x = 9;
float y = 33;
string sum = x;
sum += "+";
sum += y;
I would want the outcome to look like "9+33"
I know that seems dumb but I am actually trying something on a larger scale.
I know I could use:
cout << x << "+" << y
but I need to display this a lot so I would like it to be a string.
Thanks.
I have tried something like this but it has not worked:
float x = 9;
float y = 33;
string sum = x;
sum += "+";
sum += y;
I would want the outcome to look like "9+33"
I know that seems dumb but I am actually trying something on a larger scale.
I know I could use:
cout << x << "+" << y
but I need to display this a lot so I would like it to be a string.
Thanks.