|
-
Dec 6th, 2000, 06:09 PM
#1
Thread Starter
Frenzied Member
Is there a away to turn a long to a string?
example:
long a, b, c;
CString strTemp;
a = 1;
b = 2;
c = a + b;
strTemp = c; (Heres the problem. This would just give me the coresponding ASCII char)
AfxMessageBox("1 + 1 =" + strTemp,NULL,NULL);
Any help?
Thanks
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Dec 6th, 2000, 06:34 PM
#2
Frenzied Member
Assuming you've got <stdlib.h> included, this will do it I think:
Code:
_ltoa(c, &strTemp, 10);
Not sure if it will work with CString, here's the prototype for it anyway:
char *_ltoa( long value, char *string, int radix );
Parameters
value
Number to be converted
string
String result
radix
Base of value
Harry.
"From one thing, know ten thousand things."
-
Dec 6th, 2000, 06:36 PM
#3
Thread Starter
Frenzied Member
I got that honestly about 5 seconds before my email dinged for new mail. I got it to work, thanks for your quick response though.
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Dec 6th, 2000, 06:41 PM
#4
Frenzied Member
Harry.
"From one thing, know ten thousand things."
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
|