I have to make a maze with arrays, but i cant seem to move down or up or at all. Any help would be greatly appreciated.
Here is what I have so far


#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
#include <cmath>

using namespace std;

void up(int &, int &);
void down(int &, int &);
void left(int &, int &);
void right(int &, int &);

int main()
{

char maze[30][20];
ifstream inputFile;
inputFile.open("E:/maze.txt");


inputFile.close();

int playerX = 1;
int playerY = 0;
bool game = false;


system("cls");
for (int i = 0; i<30; i++)
{
for (int j = 0; j<20; j++)
{
cout << maze[i][j];
}

cout << endl;
}


do
{

system("cls");
for (int i = 0; i<30; i++)
{
for (int j = 0; j<20; j++)
{
cout << maze[i][j];
}

cout << endl;
}


cout << "You are currently at (" << playerX << "," << playerY << ")" << endl;
cout << "Where would you like to move next? (Up = U, Down = D, Left = L, Right = R)" << endl;
char UserMove;
cin >> UserMove;


UserMove = toupper(UserMove);
if (UserMove == 'U')
{
up(playerX, playerY);
}
else if (UserMove == 'D')
{
down(playerX, playerY);
}
else if (UserMove == 'L')
{
left(playerX, playerY);
}
else if (UserMove == 'R')
{
right(playerX, playerY);
}
else
{
cout << "Invalid, please choose another." << endl;
system("pause");
}


if (playerX == 29 && playerY == 20)
{
game = true;
}

} while (game == false);

system("cls");
cout << "Winner!!" << endl;

system("pause");
return 0;
}

void up(int &playerX, int &playerY)
{

char maze[30][20];
int prevplayerX = playerX;
int prevplayerY = playerY;

if (maze[playerX][playerY - 1] == '#')
{
playerY--;

maze[prevplayerX][prevplayerY] = '#';
}



}

void down(int &playerX, int &playerY)
{


char maze[30][20];
int prevplayerX = playerX;
int prevplayerY = playerY;

if (maze[playerX][playerY - 1] == '#')
{
playerY++;

maze[prevplayerX][prevplayerY] = '#';
}



}

void left(int &playerX, int &playerY)
{


char maze[30][20];
int prevplayerX = playerX;
int prevplayerY = playerY;

if (maze[playerX][playerY - 1] == '#')
{
playerY--;

maze[prevplayerX][prevplayerY] = '#';
}



}

void right(int &playerX, int &playerY)
{

}