|
-
Nov 11th, 2000, 03:43 AM
#1
Thread Starter
Member
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 ?
-
Nov 11th, 2000, 08:19 AM
#2
Frenzied Member
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);
-
Nov 11th, 2000, 08:47 AM
#3
Monday Morning Lunatic
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);
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|