I need help debugging the following block of code. This block of code gives me a segmentation fault error only when i attempt to assign an appropriate(char) value to squares[ i ][ j ]. How can I fix this?
for(int i=0;i<sides;i++){
for(int j=0;i<sides;j++){
squares[i][j] = '';
}
}
I declared the array squares[][] with the following code before the nested for loop:
char **squares = new(nothrow) char*[sides-1];
for(int i=0; i < sides-1; i++){
squares[i] = new char[sides-1];
}
i<sidesinstead ofj<sides