Your logic is confused, you’re trying to do too much at once. Separate out the different things you are trying to do. Like this
void generator(){
// set the whole area to "+"
for(int rows=0; rows<10; rows++)
for(int cols=0; cols<10;cols++)
gameArea[rows][cols] = "+";
// set the position of the hero
gameArea[x][y] = hero;
// print the area
for(int rows=0; rows<10; rows++)
{
for(int cols=0; cols<10;cols++)
cout << gameArea[rows][cols];
cout << endl;
}
}
solved (Beginner C++) Code not working [closed]