I currently have a managed C++ class with a method that looks like this...
int Calculate(double price, double quantity)
I can call this method from my C# library like this...
MyLib.Calculate(1,1)
However I now want to pass in an array of structs that are defined in my C++ library instead of price and quantity primitives.
typedef struct my_prices {
double quantity;
double price;
}
So my C++ method signature then changes to this...
int Calculate(my_prices prices[])
What I'm struggling with now is how to call this managed C++ method and pass it the array of prices from C#. I can't seem to create this struct in C#, I've tried defining a C# version of it but am at a loss as to how I proxy it to the C++ version.
I hope this makes sense, I'm a C# developer with very little C++ experience so may be talking rubbish.