Your code is not clear. If name is a native char * then you need to convert from String back to char * like this:
StringToHGlobalAnsi() allocates memory for you that needs a call to FreeHGlobal() in order to release it.Code:char* str2 = (char*)(void*)Marshal::StringToHGlobalAnsi(managedString); strncpy(destNativePtr, str2); // Or whatever you want Marshal::FreeHGlobal(str2); // Required




Reply With Quote