Tic Tac Toe Issue- Calling functions

So i've been working on a basic tic tac toe game in Visual studio, except when i try to run it, it says my function's identifiers are not found. I'm pretty sure my code was correct, but what's up with it?

#include <iostream>
#include <array>
using namespace std;
char matrix[9] = { '1', '2', '3', '4', '5', '6', '7', '8', '9'};
char playersquare = 'o';
void printBoard()
{
cout << " | | " << endl;
cout << " " << matrix[0] << " | " << matrix[1] << " | " << matrix[2] << endl;

cout << "_____|_____|_____" << endl;
cout << " | | " << endl;

cout << " " << matrix[3] << " | " << matrix[4] << " | " << matrix[5] << endl;

cout << "_____|_____|_____" << endl;
cout << " | | " << endl;

cout << " " << matrix[6] << " | " << matrix[7] << " | " << matrix[8] << endl;

cout << " | | " << endl << endl;
}
int input()
{
int choice = 0;
cout << "Enter your number" << endl;
cin >> choice;
changeplayer();
changesquare(choice);
checkVictory();

}

void changesquare(int choice)
{
if (matrix[choice] != ('x' || 'o'))
{
if (matrix[choice] != playersquare)
{
matrix[choice] = playersquare;
}
}
}
void changeplayer()
{
if (playersquare = 'x')
{
playersquare = 'o';
}
else
{
playersquare = 'x';
}

}
bool checkVictory()
{
if (checkrow() || checkcol() || diagonal())
{
return true;
}
return false;
}

bool check(char a, char b, char c)
{
if (a == b && b == c)
{
return true;
}
return false;
}

bool checkrow()
{
if (check(matrix[1], matrix[2], matrix[3]) == true || check(matrix[4], matrix[5], matrix[6]) == true || check(matrix[7], matrix[8], matrix[9]) == true)
{
return true;
}
return false;
}

bool checkcol()
{
if (check(matrix[1], matrix[4], matrix[7]) == true || check(matrix[2], matrix[5], matrix[8]) == true || check(matrix[3], matrix[6], matrix[9]) == true)
{
return true;
}
return false;
}
bool diagonal()
{
if (check(matrix[1], matrix[4], matrix[9]) == true || check(matrix[3], matrix[5], matrix[7]) == true)
{
return true;
}
return false;
}

int main()
{
while (checkVictory() == false)
{
printBoard();
input();
}


return EXIT_SUCCESS;
}


Here's what the errors look like:
1>c:\users\micha\source\repos\project2\project2\source.cpp(29): error C3861: 'changesquare': identifier not found
1>c:\users\micha\source\repos\project2\project2\source.cpp(30): error C3861: 'checkVictory': identifier not found
1>c:\users\micha\source\repos\project2\project2\source.cpp(36): warning C4805: '!=': unsafe mix of type 'char' and type 'bool' in operation
1>c:\users\micha\source\repos\project2\project2\source.cpp(58): error C3861: 'checkrow': identifier not found
1>c:\users\micha\source\repos\project2\project2\source.cpp(58): error C3861: 'checkcol': identifier not found
1>c:\users\micha\source\repos\project2\project2\source.cpp(58): error C3861: 'diagonal': identifier not found
In the function input you call changeplayer(); but changeplayer isn't known at this time because it comes after input. Same with the other functions.
Better to use function prototypes so you don't have to worry about the order of the functions.
https://en.wikipedia.org/wiki/Function_prototype
http://www.cplusplus.com/articles/yAqpX9L8/
Topic archived. No new replies allowed.