returning managed variable

Hi All,

I would like to return a managed array from a class is this possible?

or what would be an other good solution or should I return a pointer to a managed array ?

Many thanks
could you show me an example? i dont quite know what you're trying to ask.
lets say I have a class with a method

class firstclass {
int x, y;
public:
void set_values (int,int);
{

array<array<int>^>^ arr = gcnew array<array<int>^> (5);

for(int i=0, j=10; i<5; i++, j+=10)
{
arr[i] = gcnew array<int> (j);
}

return arr;
}

};


I would like to receive arr into an other function/class
anyone ?
closed account (o3hC5Di1)
Hi there,

As far as I know it's not possible to pass an array to a function as an argument.
Their are some workarounds though, one would be to wrap the array in an object and pass the object.

Maybe someone more experienced has a more elegant solution.

Hope that helps.

All the best,
NwN
Topic archived. No new replies allowed.