Feb 18, 2015 at 12:26am UTC
Well, you never store any values in your array, so it just has the same random garbage values from when the program started.
Feb 18, 2015 at 1:42am UTC
You have the car set to reverse and you're asking my why it's not in drive - I'm not sure what to tell you.
Don't loop in reverse? Line 28 should be a for loop.
Feb 18, 2015 at 1:43am UTC
What should the condition be, and is the only thing needed to make it print right the for loop?
Feb 18, 2015 at 1:56am UTC
Why not just use a traditional for-loop?
for (int i = 0; i < n ; ++i)
Feb 18, 2015 at 2:36am UTC
Are you pranking me? Why did you start your loop at -1 instead of 0?
Lines 29 to 31 should not exist - that should have already been don by your function.
Line 32 needs to use i
Feb 18, 2015 at 2:39am UTC
I fixed Line 32, but it still doesn't work...
Feb 18, 2015 at 2:40am UTC
Please post your current code so I can see exactly what you mean by the word "fixed"
Feb 18, 2015 at 2:54am UTC
Line 29 should not exist - you want to use your existing digits array.
On line 35 you want to use digits[i]
Feb 18, 2015 at 3:27am UTC
Your explode function still isn't changing the values in the array parameter.
Feb 18, 2015 at 3:33am UTC
What do I need to change to make it do that?
Feb 18, 2015 at 3:37am UTC
Well, after deleting line 8, you'll need a variable to keep track of how far along into the array you are (I would call it i ) and then inside the while loop you would store a value at that point in the array and then increment that variable.
Feb 18, 2015 at 3:44am UTC
What value would I store at array[i] though? It still prints a load of garbage with array[i] = digit.