#include using namespace std; void displayGrid(char a[][3]) { // Row for(int row=0;row<3;row++) { // Column for(int column=0;column<3;column++) { cout << a[row][column]; } // Go to the next line. cout << endl; } } void clearGrid(char a[][3]) { // Row for(int row=0;row<3;row++) { // Column for(int column=0;column<3;column++) { a[row][column]='.'; } } } int main() { char grid[3][3]; clearGrid(grid); grid[1][1]='X'; grid[2][2]='O'; grid[0][1]='X'; grid[1][2]='O'; displayGrid(grid); return 0; }