title: How to convert System::IntPtr to char*
body: <p>can any body tell How to convert System::IntPtr to char* in managed c++
  this is my main function</p>
  
  <pre><code>int main(void) 
  {
      String* strMessage = "Hello world";
  
      CManagedClass* pCManagedClass = new CManagedClass();//working
      pCManagedClass-&gt;ShowMessage(strMessage);//working
  
  
  ****above said error here***    
         char* szMessage = (char*)Marshal::StringToHGlobalAnsi(strMessage);
      CUnmanagedClass cUnmanagedClass; cUnmanagedClass.ShowMessageBox(szMessage);
      Marshal::FreeHGlobal((int)szMessage);
  
      return 0;
  }
  </code></pre>
  
  <p>thanks in advance</p>