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

有帮助吗?

解决方案

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!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top