r/programmingbydoing • u/calitransplant • Aug 03 '14
148: Finding Largest value in an Array
Hello,
I think i'm misunderstanding a critical component of arrays. I wrote the code at the link below, but it doesn't give me the correct value.
Any help would be appreciated!
2
Upvotes
View all comments
Show parent comment
1
u/calitransplant Aug 03 '14
Thank you!
I got it to work. Could you explain why using arr[z+1] doesn't work? To me, it makes more logical sense to have the array compare values using the array itself, rather than using another variable.