How to assign the 1st dimension of 2D array to a pointer

  • Thread starter Thread starter Silvers11
  • Start date Start date
S

Silvers11

Guest
Hello!

I have a 2D array and I am trying to assign the 1st dimension of that 2D array to a pointer like below but that doesn't work.

fixed (byte* fixedInput = array2D[0])

How can I assign only the first dimension like I am trying to do to "fixedInput"?

fixedInput will then be a 1 dimensional pointer array with all info from the 1st dimension of array2D


unsafe static void testFunction()
{
byte[,] array2D = new byte[10, 100];

fixed (byte* fixedInput = array2D[0])
{
}
}

Continue reading...
 
Back
Top