C++ Boolean function returning 56
<p>I have a function to return a bool:</p>

<pre><code>bool restart()
{
    std::string answer;
    bool answered = false;
    while(answered == false)
    {
        cout &lt;&lt; endl &lt;&lt; endl &lt;&lt; "Do you want to play again? y/n : ";
        cin &gt;&gt; answer;
        if(answer == "y" || answer == "Y" || answer == "1" || answer == "yes")
        {return true;}
        if(answer == "n" || answer == "N" || answer == "0" || answer == "no")
        {return false;}
    }
}
</code></pre>

<p>When I call it using:</p>

<pre><code>cout &lt;&lt; restart();
</code></pre>

<p>I get the output:</p>

<pre><code>Do you want to play again? y/n : y
56
</code></pre>

<p>Can anyone see how to fix this strange problem? 
Thanks in advance.</p>

<p>My WIP code as it is now:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;cstdlib&gt;

using namespace std;

void drawScreen(int grid[3][3]);                               //
int movef(int grid[3][3], bool playersMove);
int updateGrid(int grid[3][3], int move, bool playersMove);
bool hasWon(int grid[3][3]);
bool swapMover(bool playersMove);                              //
bool restart();
void endGame();

int main()
{
    int grid[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
    bool appRunning = true, gameRunning = true, playersMove = true;
    int move;

    // tests //
    std::cout &lt;&lt; restart();
    // tests //

    //while(appRunning == true)
    //{
    //    while(gameRunning == true)
    //    {
    //        drawScreen(grid);
    //        move = movef(grid, playersMove);
    //        grid[3][3] = updateGrid(grid, move, playersMove);
    //        drawScreen(grid);
    //        gameRunning = hasWon(grid);
    //        playersMove = swapMover(playersMove);
    //    }
    //    appRunning = restart();
    //}
    //endGame();
    }

    void drawScreen(int grid[3][3])
    {
        for(int i = 0; i &lt; 3; i++)
        {
             for(int j = 0; j &lt; 3; j++)
             {
             if(grid[i][j] == 10){cout &lt;&lt; "X  ";if(j == 2){cout &lt;&lt; endl &lt;&lt; endl;}}
             if(grid[i][j] == 11){cout &lt;&lt; "O  ";if(j == 2){cout &lt;&lt; endl &lt;&lt; endl;}}
             if(grid[i][j] != 10 &amp;&amp; grid[i][j] != 11){cout &lt;&lt; grid[i][j] &lt;&lt; "  ";
             if(j == 2){cout &lt;&lt; endl &lt;&lt; endl;}}
             }
        }
   }

  int movef(int grid[3][3], bool playersMove)
  {
       return 0;
  }

  int updateGrid(int grid[3][3], int move, bool playersMove)
  {
       return 0;
  }

  bool hasWon(int grid[3][3])
  {
      return false;
  }

  bool swapMover(bool playersMove)
  {
       if(playersMove == true){return false;}
       if(playersMove == false){return true;}
  }

bool restart()
{
    std::string answer;
    bool answered = false;
    while(answered == false)
    {
       cout &lt;&lt; endl &lt;&lt; endl &lt;&lt; "Do you want to play again? y/n : ";
       cin &gt;&gt; answer;
       if(answer == "y" || answer == "Y" || answer == "1" || answer == "yes")
       {return true;}
        if(answer == "n" || answer == "N" || answer == "0" || answer == "no")
       {return false;}
    }
}

void endGame()
{

}
</code></pre>
