Click to See Complete Forum and Search --> : Conversion


QuinnJohns
July 18th, 2005, 11:09 PM
Would I have to write my own macro to do conversions? or are there any prebuilt functions to handle conversions, from Texbox entries.

-ascii -> ascii
txtConverTo->Text = txtConvertFrom->Text

-ascii -> hex
txtConverTo->Text = hex(txtConvertFrom->Text)
--- gives
error C2664: 'std::hex': cannot convert parameter 1 from 'System::String __gc *' to 'std::ios_base &' ------ how would I fix it? please?

QuinnJohns
July 18th, 2005, 11:39 PM
How do I convert between :

ascii binary hex octal --- respectively...
using Visual C++ .Net?

hex( ..etc ) doesn't work.

I'm using two textboxes :
txtConvertTo and txtConvertFrom ----
Any Ideas?

philkr
July 19th, 2005, 04:30 AM
I don't know if that is what you mean:
1) atoi
2) itoa

Andy Tacker
July 19th, 2005, 05:44 AM
Look for Format function in STRING class...

Jinto
July 20th, 2005, 09:23 AM
The Managed C++ equal to atoi is Convert::ToInt32( ).

String* str = S"1002";
int number = Convert::ToInt32( str );

And back again.

int number = 1002;
String* str = number.ToString( );