I am trying to display myValue in the MessageBox. I use C++ 2008.
How is this possible. It seems that MessageBox in this case only can display a string, "".
int myValue = 0;
double myVal2 = 3.14;
myValue = myVal2;
MessageBox::Show(myValue);
I am trying to display myValue in the MessageBox. I use C++ 2008.
How is this possible. It seems that MessageBox in this case only can display a string, "".
int myValue = 0;
double myVal2 = 3.14;
myValue = myVal2;
MessageBox::Show(myValue);
I would guess stringstream.
Untested, because I'm lazy:
Code:std::string myValue; std::stringstream myValueSS; myValueSS << myVal2; myValue = myValueSS.str();
Please don't cross-post.
http://cboard.cprogramming.com/showthread.php?t=98301
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.