#include <iostream>
#include <array>
#include <vector>
using namespace std;
int main() {
char o='A';
char PlayField3[5][5] = {{o,o,o,o,o},{o,o,o,o,o},{o,o,o,o,o},{o,o,o,o,o},{o,o,o,o,o}};
std::array<std::array<char,5>, 5> PlayField2{{{o,o,o,o,o},{o,o,o,o,o},{o,o,o,o,o},{o,o,o,o,o},{o,o,o,o,o}}};
// or:
std::array<std::array<char,5>, 5> PlayField;
for(auto& row : PlayField){
for(auto& place : row){
place=o;
}
}
cout << PlayField[2][3] << std::endl;
// or:
std::vector<std::vector<char>> PlayFieldVec(5,std::vector<char>(5,o));
cout << PlayFieldVec[2][3] << std::endl;
}
// with char[][] like this:
class field
{
private:
char PlayField[5][5];
public:
char o = 'o';
field() : PlayField{ { o, o, o, o, o }, { o, o, o, o, o }, { o, o, o, o, o }, { o, o, o, o, o }, { o, o, o, o, o } }
{}
};
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YXJyYXk+CiNpbmNsdWRlIDx2ZWN0b3I+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgljaGFyIG89J0EnOwoKCWNoYXIgUGxheUZpZWxkM1s1XVs1XSA9IHt7byxvLG8sbyxvfSx7byxvLG8sbyxvfSx7byxvLG8sbyxvfSx7byxvLG8sbyxvfSx7byxvLG8sbyxvfX07CglzdGQ6OmFycmF5PHN0ZDo6YXJyYXk8Y2hhciw1PiwgNT4gUGxheUZpZWxkMnt7e28sbyxvLG8sb30se28sbyxvLG8sb30se28sbyxvLG8sb30se28sbyxvLG8sb30se28sbyxvLG8sb319fTsKCgkvLyBvcjoKCXN0ZDo6YXJyYXk8c3RkOjphcnJheTxjaGFyLDU+LCA1PiBQbGF5RmllbGQ7Cglmb3IoYXV0byYgcm93IDogUGxheUZpZWxkKXsKCQlmb3IoYXV0byYgcGxhY2UgOiByb3cpewoJCQlwbGFjZT1vOwoJCX0KCX0KCWNvdXQgPDwgUGxheUZpZWxkWzJdWzNdIDw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