Line 3 in your first snippet doesn't do anything. when you realise this you can see they're the same. I think :)
In line 3, you are just putting the contents of array[count] into the integer val and returning val instead of array[count].
The difference is that one doesn't work, and the other almost works but gives in to the dark evil forces that add extra lines to people's code.
but they do the same thing do they not?
Unfortunately yes. It's just that the first one tried and failed whereas the second is simply wrong.
Last edited on