Have:
[DllImport("OpenAL32.dll")]
static extern void alcOpenDevice(char*[] devicename);
Wanna send the name to this function like smth that:
char[] data = "Hello!".ToCharArray();
char*[] txt = &data;
But getting the errors:
cannot implicitly convert type
char[] *
tochar * []
(funny error, because C# compiler refuses to define
char[] *
in /unsafe mode also :) )Cannot take the address of, get the size of, or declare a pointer to a managed type (
char[]
)
PS
When does char
become managed? It's a struct, isn't it?
public struct Char : IComparable, IConvertible, IComparable<char>, IEquatable<char>
Although compiler showed info about declaring the pointer to a managed type (char[]
). I can only suggest that when the type is an array CLR may present it like a managed type, but it sounds very crazy.