How can i digitalread in for loop?

Hello

I want to create a program that when i press a button then a led will be litted. Then when a turn it again, an another led will be litted etc.

My idea was to create an array that will contain 8 ledpins (8 LEDS) and 8 ledstates ( if they are High or Low). Then i will use a For loop. When I press the button, then it adds +1 in my variable, i (i++). Finally the program digitalwrite (ledstate{i}, ledpin(i), on so on.

My question is, how can i combine digitalRead and For?

A for loop is used when you want something to increment by itself.
You have no reason to use it if you are incrementing with a button.
Have a variable that increments with a button state change. That's all you need to do.

Sounds like you have done some coding on this, why not show us what you have?