A
Albert Albani
Hello
I have a problem that I cannot seem to solve
I have a c funtion in a DLL that basically looks like
func_c (some_struct* s) {...}
some_struct is defined like so:
struct some_struct {
int count_bytes; // number of
// elements in array_int
int* array_int;
}
In the c# code, I go like
[DllImport("my.dll")]
unsafe private static extern int func_c(some_struct** ao);
/*...*/
unsafe private SOME_FUNC_NAME () {
some_struct s = new some_struc;
s.count_bytes = 10;
// here, I want to set
// s.array[0] = 44;
// s.array[1] = 58;
//...
// s.array[9] = 10;
}
But I have no idea how to create the array (new int[] or what)
and how to assign the numbers to the array.
Any help appreciated
Albert
I have a problem that I cannot seem to solve
I have a c funtion in a DLL that basically looks like
func_c (some_struct* s) {...}
some_struct is defined like so:
struct some_struct {
int count_bytes; // number of
// elements in array_int
int* array_int;
}
In the c# code, I go like
[DllImport("my.dll")]
unsafe private static extern int func_c(some_struct** ao);
/*...*/
unsafe private SOME_FUNC_NAME () {
some_struct s = new some_struc;
s.count_bytes = 10;
// here, I want to set
// s.array[0] = 44;
// s.array[1] = 58;
//...
// s.array[9] = 10;
}
But I have no idea how to create the array (new int[] or what)
and how to assign the numbers to the array.
Any help appreciated
Albert