Simple Battleship Game Advice
<p>For my class, I need to make a pretty basic Battleship game. However, I'm new to programming and am running into some problems. First, let me explain my idea for the program. I'd like to keep two separate 2D arrays for each player's gameboard. I have a function for placing each ship, and I will make other functions that incorporate those into one "turn" function. The gameboard will begin by being filled with O's, and each ship placement will replace an O with the first letter of the ship. A hit will be designated as an X. Once the ships have been placed, a winner will be determined when a board only has X's and O's left. The main problem I'm running into right now is with my 2D arrays. I want to place them in a struct, but I'm running into a couple of errors that I don't know how to handle. I'm getting an "expected unqualified-id before '.' token" on the board.firstboard = line. The other error I'm getting is saying I'm missing a } but if I add one, it says it's an extra. Is this related to the previous error? Thanks for any help! Also, I'm not sure if I provided my code correctly, so let me know if I didn't and I'll correct it!</p>

<pre><code>    struct board
{
    static char firstBoard[10][10] ;
    static char secondBoard[10][10] ;
} ;

void initializeBoard()
{

    board.firstBoard =
    {
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
    } ;

    board.secondBoard =
    {
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
        {'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O'},
    } ;
}
</code></pre>
