public int[] boardState; // State of the baord
void Start ()
{
foreach(state in boardState)
{
state = 0;
}
}
error CS0230: Type and identifier are both required in a foreach statement
private var boardState: int[]; // State of the baord
// Set board state to off
boardState = new int[9];
for (state in boardState)
{
state = 0;
}
the code in java script is working fine but when i am trying to adopt same code in c # the error is coming
CS0230: Type and identifier are both required in a foreach statement
so how to modify the above java script to work in c#.
error CS1656: Cannot assign to
– anon16754120state' because it is aforeach iteration variable'Sorry, I didn't even bother to look at what was in the loop. You can't use foreach. A for loop is required.
– Jessy