if you want to print numbers in MessageBox() or TextOut(), how do you do this? i mean not just a number, but putting a variable into the parameter of the aforementioned functions.
thanks,
jmiller
Printable View
if you want to print numbers in MessageBox() or TextOut(), how do you do this? i mean not just a number, but putting a variable into the parameter of the aforementioned functions.
thanks,
jmiller
Code:char tmp[30];
int i = 32;
sprintf(tmp,"%d",i);
MessageBox(hWnd,tmp,NULL,MB_OK);
Get the full power of streams :DCode:ostringstream tmp;
int i = 32;
tmp << i;
MessageBox(hWnd,tmp.str().c_str(),NULL,MB_OK);
sorry, but that doesn't answer my question.
what i really need to do is add a number on to a string. In VB it would have been like:
dim z as String
dim x as integer
z = "blah"
x = 1
z = z & x
and CornedBee, for some reason my compiler(vc++6) doesn't recognize ostringstream. what header do i include?
nevermind, i've got it. i didn't include <sstream>