C# P/Invoke to pass pointer-to-pointer-to-structure (**pPtr) to C

G

Guest

I have a function in C which takes a pointer to a pointer to a structure. It
then returns a linked list.

How do I call, via P/Invoke, from C# to C.

struct LinkedList
{
char *value;
struct LinkedList *next;
}

void CreateList(struct LinkedList **pPtr)
{

// creates the linked list

}

How do I call CreateList from C#? I know I need to declare the structure
and then create an instance of this structure, but I can't figure out how to
pass a pointer to a pointer to the structure.

- Bruce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top