This is my problem
int i;
i = sizeof(num);
I need to take the value of integer i and display it in a message box, but when i try this
MessageBox(i);
I get an error
How can i display integers
Marky_Mark
Printable View
This is my problem
int i;
i = sizeof(num);
I need to take the value of integer i and display it in a message box, but when i try this
MessageBox(i);
I get an error
How can i display integers
Marky_Mark
Hi,
If you look at the MessageBox() Function you would see that it takes a string param, not an int.
So you need to put your int into a string then use the message box function.
A bit like this...
[code]
int mynum = 666;
char mybuffer[10];
wsprintf(mybuffer, "%d", mynum);
//note the code!! not 1 param
MessageBox(hWnd, mybuffer, "HELLO Gr8 Day!", MB_ICONERROR);
Hope you can adapt that. ;)
Cheers
TNT