Hi man !
If you are still struggling to fix the clock with sledgehammer [

], here is something that I wrote today :
Code: C
void RecursiveCombine(int A[], int SizeA, int B[], int SizeB, int C[], bool InitialCall=true)
{
static int IndexA, IndexB, IndexC;
if( InitialCall ) IndexA = IndexB = IndexC = 0;
if( IndexA < SizeA )
if( IndexB < SizeB )
if( A[IndexA] < B[IndexB] ) C[IndexC++] = A[IndexA++];
else C[IndexC++] = B[IndexB++];
else
C[IndexC++] = A[IndexA++];
else
if( IndexB < SizeB ) C[IndexC++] = B[IndexB++];
else return;
RecursiveCombine(A, SizeA, B, SizeB, C, false);
}
You can should call it this way :
Code: C
RecursiveCombine(X, sX, Y, sY, Z);
or this way :
Code: C
RecursiveCombine(X, sX, Y, sY, Z, true);
Hope that helps.