recently i want to convert some codes from opencv to c#. But I have some problem in declaring the dynamic array in c++.
int* memorySteps = 0;
CV_CALL( memorySteps = new int [ 10*sizeof(memorySteps[0]) ]);
I want to convert it to a normal c# int array. The problem is the length.In c++, the declaration above seems that the compilor will create an array with 40 int elements(coz the sizeof the type memorySteps[0] is 4, 4 bytes length.). Is my understanding correct? However, it doesnt make sense because actually in the algorithm I only need an array of 10 int elements. So can anyone give me a hint which is right in the following(in c#), or can anyone show me other examples:
int[] memorySteps =new int [10*sizeof(int)];
or
int[] memorySteps =new int [10];