Hi,
I'm trying to convert this C printf to C#
printf("%c%c",(x>>8)&0xff,x&0xff);
I've tried something like this:
int x = 65535;
char[] chars = new char[2];
chars[0] = (char)(x >> 8 & 0xFF);
chars[1] = (char)(x & 0xFF);
But I'm getting different results. I need to write the result to a file so I'm doing this:
tWriter.Write(chars);
Maybe that is the problem.
Thanks.