I'm trying to fill an array that is contained within a structure with some values but I keep getting errors no matter what I try.
my structure looks like this
public struct boardState
{
public int structid;
public char[] state;
}
bellow in the initializer I'm creating a new boardState and trying to fill it with some values like this
boardState _state_ = new boardState();
_state_.structid = 1;
_state_.state[9] = {'o','-','-','-','o','-','-','-','-','o'};
structid seems to work fine, but I get an error at the {'o','-' etc etc} telling me '; expected'. I've been through the code above and ensured that there are no ;'s missing (confirmed by the program running without this line) so I'm guessing you can't assign to the array in this way. How can I assign to the state array?
EDIT: - added the comma that I'd missed but still getting the same error.