First off -- You know about loops, so what is that monstrosity of a list of
stuff deciding who has won. Why not use a loop.
The problem is actually in the last two else if statements.
board1[5][5] which does two things. (A) there is no board[5][5] the
array is ranged 0-4 + 0-4 so that is a random UNKNOWN memory location. (B) use didn't you mean [row][col].
(C) it is pain ugly.
const char PUnit[]="X 0";
for(int row=0;row<5;row++)
{
for(int col=0;col<5;col++)
std::cout<<PUnit[board1[row][col]];
std::cout<<std::endl;
} Note that the idea in this code, effectively transform -1/0/1 into characters. You might want a if guard on the values BUT it is possible that is only in debug mode as you shouldn't be able to get out of the -1,0,1 range on board1.
p.s Sorry but there are other errors with your code. BUT how to test code is also part of the process of learning to program. (and is easily transferable to any other language -- most likely a more important skill than how to write C++. )