| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Managed C++ and C++/CLI Discuss Managed C++ and .NET-specific questions related to C++. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Conversions : Ascii, Hex, ... Octal
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? |
|
#2
|
|||
|
|||
|
Conversion ====================
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? |
|
#3
|
|||
|
|||
|
Re: Conversions : Ascii, Hex, ... Octal
I don't know if that is what you mean:
1) atoi 2) itoa
__________________
Please don't forget to rate users who helped you! |
|
#4
|
|||
|
|||
|
Re: Conversions : Ascii, Hex, ... Octal
Look for Format function in STRING class...
|
|
#5
|
||||
|
||||
|
Re: Conversion
The Managed C++ equal to atoi is Convert::ToInt32( ).
Code:
String* str = S"1002"; int number = Convert::ToInt32( str ); Code:
int number = 1002; String* str = number.ToString( );
__________________
"Lose it? It means go crazy...nuts...insane...bonzo...no longer in possession of one's faculties...3 fries short of a happy meal...WACKO!!!" |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|