hi friend,
When I call the C++ dll function, the following error occurred:
Error Message=Attempts to read from or write to protected memory. This is often an indication that other memory is corrupt.
C++ codes:
C# codes:
class Program
{
[DllImport("safeTest.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern string test(string[] s);
static void Main(string[] args)
string[] city = { "London ", "San Francisco " };
string temp = test(city);
Thanks.