Your array is of "buttons", so the reference should look like:
buttons[0].val= digitalRead(buttons[0].pin);