Hello! There was the following problem.
char **map = new char*[s]; //так я объявляю двумерный динамический массив for(int i = 0; i < s; i++) map[i] = new char[c];
Next, I initialize it. When you try to display it, everything runs smoothly.
cout << map[i][j]; // так я вывожу каждый элемент массива(в цикле)
But when you try to change the value of an array element, the program fails.
map[x][y] = 'H'; // так я пытаюсь присвоить нужному элементу массива конкретное значение.
Actually, here's the error: "Unhandled exception at 0x00fa16f1 in test.exe: 0xC0000005: Access violation writing location location 0x00fa89b5."
I guess that because pointers are used, it is impossible to directly change the value in the memory to which they are pointing, but I don’t know how to do it correctly.