M
Mat
Hi all.
This is my situation:
- I have 3 arrays, for example:
unsigned char myArray1[16] =
{
11, 12, 13, 14,
21, 22, 23, 24,
31, 32, 33, 34,
41, 42, 43, 44
};
unsigned char myArray2[16] =
{ /* like myArray1, different elements of course */ }
unsigned char myArray3[32];
( in my real code the array size is bigger... )
- I would like to merge myArray1 and myArray2 in myArray3 in this way:
myArray3[0] = myArray1[0]
myArray3[1] = myArray1[1]
myArray3[2] = myArray1[2]
myArray3[3] = myArray1[3]
myArray3[4] = myArray2[0]
myArray3[5] = myArray2[1]
myArray3[6] = myArray2[2]
myArray3[7] = myArray2[3]
// ...
So I need to copy alterned lines of n elements (n fixed) from the
arrays and I would like to do without a loop... I need to do this
operation very fast and without using many resources (CPU).
Is it possible?
Any good ideas?
[OT]Ok ok, I know it's OT but my OS is Linux so if someone knows a
system-dependent solution is welcome too...[/OT]
Tnx in advance.
-Mat-
This is my situation:
- I have 3 arrays, for example:
unsigned char myArray1[16] =
{
11, 12, 13, 14,
21, 22, 23, 24,
31, 32, 33, 34,
41, 42, 43, 44
};
unsigned char myArray2[16] =
{ /* like myArray1, different elements of course */ }
unsigned char myArray3[32];
( in my real code the array size is bigger... )
- I would like to merge myArray1 and myArray2 in myArray3 in this way:
myArray3[0] = myArray1[0]
myArray3[1] = myArray1[1]
myArray3[2] = myArray1[2]
myArray3[3] = myArray1[3]
myArray3[4] = myArray2[0]
myArray3[5] = myArray2[1]
myArray3[6] = myArray2[2]
myArray3[7] = myArray2[3]
// ...
So I need to copy alterned lines of n elements (n fixed) from the
arrays and I would like to do without a loop... I need to do this
operation very fast and without using many resources (CPU).
Is it possible?
Any good ideas?
[OT]Ok ok, I know it's OT but my OS is Linux so if someone knows a
system-dependent solution is welcome too...[/OT]
Tnx in advance.
-Mat-