I've got a program where the user is giving the program the size of the array ie(the column and row size) and I am trying to give every position in the array the same value. I'm having an issue with my loop though, here it is.
for(int i = 0; i < row; i++){
for(int j = 0; j < col; j++){
//CODE
}
}
I can see that the issue is I am trying to give a value to a position that doesn't exist but I have no idea how to work around this issue. Any help would be appreciated :)
new Whatever[row][col]?