ok, im making a text based rpg but i need msg boxes to show something like "You've earned 12 gold" on it. Unfortunetly i need the number to be a variable and change if the variable does.
Any help plz?
ok, im making a text based rpg but i need msg boxes to show something like "You've earned 12 gold" on it. Unfortunetly i need the number to be a variable and change if the variable does.
Any help plz?
Since you say Msg Box, this is a windows question right?
And those should be in the windows forum.
Myself, i have no idea.
Hmm just like ErionD said this is a Windows specific function you should of asked on the Windows board, but ill answer what I think your askign. If you need to have the value as an int or whatever then store it as one, then when you need to display a message box convert the number to a char ex:
Code:int x = 15; char val[33]; // This is the max length that itoa can fill itoa(x,val,10); // x is the num to convert, val is the buffer to write to and 10 is the base number (10 = Dec, 16 = Hex, 8 = Oct, 2 = Bin) MessageBox(NULL,"The message",val,MB_OK);
"only two things are infinite, the universe and human stupidity, and im not sure about the former." - albert einstein
Or
Code:CString csText; Int iPoints = 5; csText.Format("You got %d points", iPoints); MessageBox("csText");