I have an uchar array with this arrangement :
uchar a={LowByte_val1 HighByte_val1 LowByte_val2 HighByte_val2 ...};
how to i can convert this array to (without loop)
uint b= [val1 val2 ...];
where
val1 = LowByte_val1+(HighByte_val1<<8);
I use this solution.
typedef union {
struct {
uchar lsb;
uchar msb;
}byteModel;
unsigned int data;
}XXX;
and
uchar a[24]={0,0,0,1,0,2,0,3, 1,0,1,1,1,2,1,3, 2,0,1,1,2,2,2,3};
XXX *input = new XXX[12];
and then :
memcpy(input,a,24);
but not worked :(.