Tic tac toe game using C++
I see a number of things that may help you improve your code.

Format your code

This code is messy and difficult to read.  It has inconsistent indentation, and very little whitespace, making it hard to read and understand.  There are abundant examples here of C++ code that is well formatted.  

Eliminate global variables where practical

Having routines dependent on global variables makes it that much more difficult to understand the logic and introduces many opportunities for error.  Eliminating global variables where practical is always a good idea.  In your code, there's no reason that board or N couldn't be members of the TicTacToe class instead, properly encapsulating.

Simplify your code

The code is full of duplicated code and inefficiency.  Duplicated code is a sign that you either need to refactor (for example by creating a new function) or rewrite the logic in a more compact form.  For example, there is no reason that horizontal and vertical checks couldn't be done within the same loop.  Also, only the player that just made a move could possibly win, so there's no point in checking squares which aren't marked with the current player's token.

Use better names

The variable name board is OK, but the name flag is not.  The first name explains something about what the variable means within the context of the code, but the latter is only confusing.  Also check_board is vague and unhelpful.  What is it checking?  What does it return?  Comments would help, but it's important to use descriptive names first.

Sanitize user input better

The only thing the code currently checks for is a space that's already occupied, but it does not verify that the proposed move is within bounds.  

Eliminate "magic values"

The values of 1 and 2 are sprinkled through the code, but they really ought to be a named constant instead, and specifically a named constant static member of the class.

Fix the bug

The "opposite diagonal check" has these lines (formatting fixed):

for (int i = N - 1; i &gt; 1; i--) {   //Opposite diagonal check
    for (int j = 1; j &lt; N - 1; j++) {
        if (board[i + 1][j - 1] == 1 &amp;&amp; board[i][j] == 1


The first time through the loop i - N - 1, but the check is looking at board[i + 1][j - 1] which will be board[N][0] the first time through the loop.  That's out of the boundary of the board and thus, a bug.

Think of the user

What happens if there is a tie game?  The board is full, but neither player has won.  The code doesn't check for or recognize this state, but it should, to avoid a frustrating experience for a user.

Study other code

One way to become a better programmer is to ask for a review of your code.  You've just done that, so good job!  Another way that helps is to read other people's code.  Look at other implementations of this game on Code Review and carefully read the answers.  It's a very simple way to learn a lot of good information.