1

This is probably a dumb question but I have hit a brick wall. I'm stuck. I want to add the contents in index 4 of array 1 into index 0 of array 2 then add the contents of index 4+32 in array 1 to index 1 of array 2 and so forth. Array 1 is an existing array and array 2 is being filled by a "jumping" selection coming out of array 1. I have tried everything including converting the first array into a list but it just gets messy. and array copy seems to just copy the entire array across. I would like to do this on the fly: for (int ab = 0; ab <5; ab++){ if (ac

1 Answer 1

2

So is this it?

int fromIndex = 4
int toIndex = 0;
while (fromIndex < array1.length)
{
   array2[toIndex ] = array1[fromIndex];
   fromIndex+=32;
   toIndex++;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.