practice: tic-tac-toe

Write a two-player Tic-Tac-Toe game that:

Feel free to use the code below or make any changes to it.

#include <iostream> using namespace std; void print(char marks[]); int main() { char marks[9] = { ' ' }; // this array will hold the Xs and Os /* Here's part of a way to detect whether a player has won: if (marks[0] + marks[1] + marks[2] == 'X' * 3) // then player X won */ } void print(char marks[]) { cout << "\n\n\n | |" << "\n " << marks[6] << " | " << marks[7] << " | " << marks[8] << "\n -----------" << "\n | |" << "\n " << marks[3] << " | " << marks[4] << " | " << marks[5] << "\n | |" << "\n -----------" << "\n " << marks[0] << " | " << marks[1] << " | " << marks[2] << "\n | |"; }