In VC++ 8:
Example:-
using namespace System::Runtime::InteropServices; // for class Marshal
void PrintMessage(System::String^ str)
{
const char* str2 = (char*)(void*)Marshal::StringToHGlobalAnsi(str);
printf(str2);
Marshal::FreeHGlobal((System::IntPtr)(void*)str2);
}
PrintMessage("Method 2");
Tuesday, October 27, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment