For statement inside setup and loop function

pantherturm:
I forgot to add void before setup and loop and the parentheses when i use the function digitalRead. With these changes the code compiles.

However, you are still over-writing your array of pin numbers with the values read from those pins. After you have read every pin once, all your subsequent code will just be reading pins 0 and 1 - which is unlikely to give you anything useful.