Are you sure you modified your for loops to take this into account. Also, if the user enters 2,2 because arrays start from zero you will have to translate this to 1,1 before passing the values to your functions.
Code:
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
#include <dos.h>
int col = 0, row = 0 , x = 0, y = 0;
void cls()
{
COORD coordScreen = { 0, 0 };
DWORD cCharsWritten;
CONSOLE_SCREEN_BUFFER_INFO csbi;
DWORD dwConSize;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hConsole, &csbi);
dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten);
GetConsoleScreenBufferInfo(hConsole, &csbi);
FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
SetConsoleCursorPosition(hConsole, coordScreen);
}
char t[3][3];
void DisplayTable() {
cls();
cout << "Table:\n";
for (col = 0; col < 3; col++) {
for (row = 0; row < 3; row++) {
if (t[row][col] == '1') {
cout << "X";
}
if (t[row][col] == '2') {
cout << "O";
}
if (t[row][col] == NULL) {
cout << "-";
}
}
cout << endl;
}
}
void NewTable() {
for (col = 0; col < 3; col++) {
for (row = 0; row < 3; row++) {
t[row][col] = NULL;
row++;
}
col++;
}
}
int main() {
NewTable();
cout << "Tic Tac Toe\nBy: Scott A. Hand\nEnter X: ";
cin >> x;
cout << "Enter Y: ";
cin >> y;
t[x-1][y-1] = '1';
DisplayTable();
return 0;
}