Microsoft error report when running program.

I'm trying to make a 2d array that lets you type a direction and moves a letter that direction, however when I type the direction I crash the program and one of those "send" or "dont send" error reports pop up.

Heres my code:
#include <iostream>

using namespace std;

int main()
{

        int x = 5;
        int y = 5;
        string move;
        string room[5][5] =
    {
        {"- ","* ","* ","* ","* "},
        {"* ","* ","* ","* ","* "},
        {"* ","* ","* ","* ","* "},
        {"* ","* ","* ","* ","* "},
        {"* ","* ","* ","* ","@ "}
    };


    while (move != room[0][0])
    {

    cout << "Hello World\n\n" << endl;
    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 5; j++)
        {

            cout << room[i][j];
        }
        cout << endl;
    }


    cout << "Move: ";
    cin >> move;
    if (move == "up")
    {
        room[5][y] = "* ";
        room[x][5] = "* ";
        y = y - 1;
        room[x][y] = "@ ";
        break;
    }
    }

    return 0;
}
room[5][y] = "* ";

This line accesses out of bounds of the array.

Also, it's [code][/code] not [output][/output]
Topic archived. No new replies allowed.