[StructLayout(LayoutKind.Sequential)]
public struct RecognizeResult
{
/// float
public float similarity;
/// char*
[MarshalAs(UnmanagedType.LPStr)]
public StringBuilder fileName;
}
RecognizeResult[] results = new RecognizeResult[50];
Array.ConvertAll(results, r => r.fileName = new StringBuilder(50) );
But the element of results array is not changed, the fileName of every element is null after the ConvertAll(), what's wrong?