I would like to duplicate following C logic in C# if possible:
void f(unsigned char *byteArr)
{
short *shArr = (short*)byteArr; // shArr[0] = -8, shArr[1] = -265
}
unsigned char byteArr[4];
byteArr[0] = 248;
byteArr[1] = 255;
byteArr[2] = 247;
byteArr[3] = 254;
f(byteArr);
So in C# I have
void f(byte[] byteArr)
{
short[] shArr = ?
}
and would like shArr to be {-8, -265}
. (How) is this possible?