Hi there
I am trying to create two arrays of 10000 doubles. The goal is to have one count from 0 to 10000, and have the other count down from 10000 to 0
1. You don't state your problem.
2. Why are your arrays type double when you're storing type int?
3. Lines 11 and 18 are unnecessary.
4. Initialization, condition and decrement on line 19 is wrong.
5. Increment on line 14 is unnecessary (unless you want to skip every other number).
6. Decrement on line 21 is unnecessary (when you fix line 19, and assuming you don't want to skip every other number).
for (unsignedint i= 100; i <10001; i++){
first[i] = i;
}
i starts at 100. Meaning, your array will be filled from 100-10001. Which is wrong in the first place, because place 10000 does not exist since arrays start from 0. So the first element you store in first[100] and then all the way to the end. So first[4] does not exist.