Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8520535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:33:46+00:00 2026-06-11T06:33:46+00:00

Currently I have a tic tac toe board tttBoard with a constructor tttBoard::tttBoard() {

  • 0

Currently I have a tic tac toe board “tttBoard” with a constructor

    tttBoard::tttBoard() {
    isX = true;
    for (int x = 0; x < 3; ++x) {
        for (int y = 0; y < 3; ++y) {
            gBoard[x][y]=sEmp;
        }
    }
}

That should create a new board and fill it with the enum sEmp. isX is a boolean which marks that the first player moves first. Despite having #include "tttBoard.h" and (I believe) having the constructor in that header file (below), I’ve run across the same errors over and over:

error C2589: '(' : illegal token on right side of '::'
error C2059: syntax error : '::'
error C2334: unexpected token(s) preceding '{'; skipping apparent function body

tttBoard.h

#ifndef tttBoard
#define tttBoard

class tttBoard {
public:
tttBoard();
    void            Draw();
    void            Move(int x, int y);
    char*           getValue(int x, int y);
private:
    enum sVal {
        sEmp,
        sX,
        sO
    };

    sVal            gBoard[3][3];
    bool            isX;
}

#endif
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:33:48+00:00Added an answer on June 11, 2026 at 6:33 am
    #ifndef tttBoard
    #define tttBoard
    
    class tttBoard {
    

    That’s not a proper include guard. You’re defining tttBoard as an empty symbol and then using the same name for the class.

    #ifndef TTT_BOARD_H
    #define TTT_BOARD_H
    
    class tttBoard { 
        // stuff
    };
    
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this first integration test for a tic tac toe game: [TestClass] public
I am trying to make a really simple Tic-Tac-Toe game. I have stored values
Currently have a drop down menu that is activated on a hover (from display:none
I currently have a XSLT 2.0 Stylesheet that I am trying to remove empty
I currently have one project that currently contains multiple packages. These packages make up
I currently have a deployed app (fortworth.herokuapp.com) that I am attempting to sort movies
I am going to develop a Tic-Tac-Toe game using Java(or maybe other OO Languages).
I'm building a Tic Tac Toe game in Java with a Swing GUI, and
I currently have a closure table used for hierarchical data that has 5 million
Think tic-tac-toe. You are creating the buttons in rows and columns and you want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.