There is an array
float [,] arr1;
How to convert it to double[,] ?
If by “convert” you mean “create a new array”, then:
double[,] Convert(float[,] arr) { int d0 = arr.GetLength(0), d1 = arr.GetLength(1); var result = new double[d0, d1]; for (int i0 = 0; i0 < d0; i0++) for (int i1 = 0; i1 < d1; i1++) result[i0, i1] = arr[i0, i1]; return result; } If we are talking about type conversion "in place", then, I'm afraid, in any way.
reinterpret_cast with __makeref magic can it really make the type conversion “in place”? - Anton KomyshanSource: https://ru.stackoverflow.com/questions/629883/
All Articles