I have already got the words counted, but how do I place an int in a MessageBox?
I have already got the words counted, but how do I place an int in a MessageBox?
Website(s): http://www16.brinkster.com/trifaze/
E-mail: [email protected]
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK
Use sprintf.
Does this help?Code:int num = 5; TCHAR *string; sprintf(string, TEXT("The int is %d"), num); MessageBox(NULL, string, TEXT("INTEGER"), MB_OK);
--Garfield
1978 Silver Anniversary Corvette
CORRECTION:
I think you'll have to use wsprintf due to the fact that TCHAR *string could be a pointer to wide characters.
1978 Silver Anniversary Corvette
int word_count; // you fill in
char output[100];
sprintf( output, "The Word Count Is %i !", word_count);
MessageBox(hwnd, output, TEXT("Official Word Count"), MB_OK);
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }