B.map[3][3] = { {a,a++,a++},{a++,a++,a++},{a++,a++,a++} };B.map[2][2] references one item of type char of your array which is able to hold exactly one char.
B.map[3][3] does reference an item outside of your arrays range. Each row and each column are defined of size 3. But because C/C++ starts indexing arrays elements with 0, an index of 3 references the fourth, and thus not existing, element.
To assign values to every item of your array uses f.e. a loop as @poteto has shown.
> { {a,a++,a++},{a++,a++,a++},{a++,a++,a++} }; is undefined.
It is not undefined; this is a braced-init-list.
Within the initializer-list of a braced-init-list, the initializer-clauses, including any that result from pack expansions, are evaluated in the order in which they appear. That is, every value computation and side effect associated with a given initializer-clause is sequenced before every value computation and side effect associated with any initializer-clause that follows it in the comma-separated list of the initializer-list.
[Note: This evaluation ordering holds regardless of the semantics of the initialization; for example, it applies when the elements of the initializer-list are interpreted as arguments of a constructor call, even though ordinarily there are no sequencing constraints on the arguments of a call — end note] - IS
@tcs
oh how stupid am i to think that the index of 3 is 3 not 4.
but that doesnt explain it but thank you because I thought that all this time 3 is 3 and not 4.
yea. im used to use looping and arrays together, i just make the error appeared. because
when im writing tictactoe i didnt have any choice but to find another way to avoid that error. then i realize i actually need that error too