I have already got the words counted, but how do I place an int in a MessageBox?
Printable View
I have already got the words counted, but how do I place an int in a MessageBox?
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
CORRECTION:
I think you'll have to use wsprintf due to the fact that TCHAR *string could be a pointer to wide characters.
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);