#include "stdafx.h"
#include <iostream>
int win();
int whoWins;
int main(){
int playerHorizontal;
int playerVertical;
char player = 'P';
char comp = 'C';
char grid[7][6];
int i;
int j;
for (i = 0; i < 7; i++){
for (j = 0; j < 6; j++){
grid[i][j] = 'O';
std::cout << grid[i][j];
}
std::cout << std::endl;
}
std::cout << "write the horizontal and vertical coordinates for your target place." << std::endl;
std::cin >> playerHorizontal;
std::cin >> playerVertical;
grid[playerHorizontal][playerVertical] = player;
std::cout << grid[i][j];
}
It doesn't change the O to P but instead prints a different strange character each time (after I write playerHorizontal and playerVertical).Please help.