Skip to content

string[] to byte ** / sbyte ** and byte ** / sbyte ** to string[] for example? #85740

Answered by jkotas
DeafMan1983 asked this question in Q&A
Discussion options

You must be logged in to vote

Either allocate array of pointers sbyte*[] sArgs = new sbyte*[args.Length]; and pin it using fixed;
or allocate native memory using sbyte** sArgs = (sbyte**)NativeMemory.Alloc(args.Length * sizeof(sbyte*)); and then free it using NativeMemory.Free once you are done with it.

Replies: 1 comment 15 replies

Comment options

You must be logged in to vote
15 replies
@DeafMan1983
Comment options

@jkotas
Comment options

jkotas May 4, 2023
Collaborator

@DeafMan1983
Comment options

@jkotas
Comment options

jkotas May 4, 2023
Collaborator

Answer selected by DeafMan1983
@DeafMan1983
Comment options

@DeafMan1983
Comment options

@stephentoub
Comment options

@DeafMan1983
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants