Frage

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

War es hilfreich?

Lösung

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!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top