How can i convert from (for example) long to char ?
For example: i use api, which returned long value. How can i this value view in MessageBox function ?
Printable View
How can i convert from (for example) long to char ?
For example: i use api, which returned long value. How can i this value view in MessageBox function ?
To convert the long value to char and display it in
a message box use this code:
Code:long l = 250;
char *c = new char;
MessageBox(hWnd,itoa(l,c,10),"Caption",MB_OK);
You need to have a proper buffer to avoid possible problems:
Code:long l = 250;
char c[30];
MessageBox(hWnd,ltoa(l,c,10),"Caption",MB_OK);