Allocates a string array and unmarshals the unmanaged string array into a managed string array using the specified encoding.
- stringArray
- A IntPtr containing a byte** array which follows the ANSI C rules for the argv argument passed to main.
- encoding
- A stem.Text.Encoding specifying the encoding of the unmanaged strings within stringArray.
A string array containing all the strings in the unmanaged string array. If stringArray is IntPtr.Zero, a string array containing zero elements is returned.
Type Reason ArgumentNullException encoding is null.
stringArray is assumed to be a Cchar** pointer containing a terminating IntPtr.Zero pointer to designate the end of the array. This follows the requirements for argv in the ANSI C main function declaration.
C Example
static const char* stringArray[] = { "string 1", "string 2", NULL };The final null string will not be returned from this method; the above stringArray declaration would create an array containing two elements if passed through this method.
Namespace: Mono.Unix
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0