S
Star
Hi all,
Let's suppose we have this:
byte[] buffer = new byte[3];
buffer[0] = 0x04;
buffer[1] = 0xF1;
buffer[2] = 0xB4;
int Res;
'Res' needs to be the concatenation of all those bytes.
I mean, it should be something like
Res = 0x04F1B4
which converted to integer is 324020.
On the other hand, buffer can contain any number of bytes,not only 3
(I know the length)
I tried
Res = Int32.Parse(buffer[0].ToString() + buffer[1].ToString() +
buffer[2].ToString());
but obviously it doesn't work
Any ideas?
Thanks!
Let's suppose we have this:
byte[] buffer = new byte[3];
buffer[0] = 0x04;
buffer[1] = 0xF1;
buffer[2] = 0xB4;
int Res;
'Res' needs to be the concatenation of all those bytes.
I mean, it should be something like
Res = 0x04F1B4
which converted to integer is 324020.
On the other hand, buffer can contain any number of bytes,not only 3
(I know the length)
I tried
Res = Int32.Parse(buffer[0].ToString() + buffer[1].ToString() +
buffer[2].ToString());
but obviously it doesn't work
Any ideas?
Thanks!