i am trying to stop a piece of code from printing when there is something already in a cell of a grid
what i am trying to do is if the cell in the grid is marked by a character (player) i want it to just print the cout statement and not replace the character that is already in it. the getMarked() is a bool statement to see if there is a character in the cell. it simply returns the players symbol. the mark(player) marks the cell that you are in with the players character. what it does right now is prints the character even if there is wone already in there and does not display the cout message i am so close to gettin it i know it but i cant any help would be great.Code:for(int d = 0; d <DEPTH; d++){ for(int r = 0; r<ROW; r++){ for(int c = 0; c< COL; c++) { if(!array[d][r][c].getMarked()) { array[currentDepth][currentRow][currentCol].mark(player); return; } else cout << "Space already occupied by a player choose another. " << endl; return; } } } break;