What is the meaning of static size_t length(const char_type* __s) {return strlen(__s);}? How do i solve it?

1.7k Views Asked by At

I'm doing an assignment using c++. I'm writing a reversi game using Xcode. I get the thread above when I place a marker in the top left box i.e. (1,1). I just want to know what does it mean and how can I solve it. Thank you. P.S the thread pointed at the displayTop() function.

void displayTop(){

cout << "    ";

for (int i = 0; i < ROWS; i++){
    cout << "+----";
}

cout << endl;

}
1

There are 1 best solutions below

0
Bo Persson On BEST ANSWER

Here is one place where you index outside the board. After that, anything can happen.

void clearBoard(){
    for (int i = 0; i <= ROWS; i++) {
        for (int j = 0; j <= COLS; j++) {
            board[i][j] = ' ';
        }
    }

It should be <, or preferrably !=, to stay inside the bounds of the board.