In my code, I want to store the values of four analog sensors in an array to iterate through them using for loop and check whether the value returned from any of the sensors is within a certain range, but when I compile the code before uploading it to check for error, I keep getting an error.
For that I didn't think that's either really clever or really dumb...
I don't think it does what you think it does, I've not tried to compile it, even if it does compile it won't cycle through the array, which is what I think you think it does. You are confusing the index, i, with the data stored in the array.