Question

I need help converting a parameter of type

 double* testVar 

to a parameter of type

 array<double> ^%parentVar.

I`m still trying to learn CLI C++ so this might be quite easy but I don't seem to figure it out.

Regards

Was it helpful?

Solution

Based on @Alex Farber comment the answer to this question is:

double *testVar; // This testVar takes a value from a function that I will not post here
int vectSize = 10;
array<double>^ TempVector= gcnew array<double>(vectSize);
Marshal::Copy(IntPtr(testVar),TempVector,0,vectSize);
parentVar=TempVector;

That was all!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top