| 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
|
|||
|
|||
|
Convert a String to a const char
I would like to convert a string from a list box to a const char so I can use it in a fopen( ) call any suggestions out there??
Thanks |
|
#2
|
||||
|
||||
|
Re: Convert a String to a const char
Code:
String* str = S"somestring"; const char* str2 = (const char*)Runtime::InteropServices::Marshal::StringToHGlobalAnsi( str ).ToPointer( );
__________________
"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 |
|
|