int isEmptySquare[39][39]; /*as a global variable*/
void drawBoard(){
if(!initialized){
isEmptySquare[0]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
}/*this is inside a function*/
and i get the following errors, isEmptySquare: expected a modifiable lvalue.
Why? isnt the matrix modifiable?
You can't assign arrays using the = operator except for initialisation. If you want to initialise your entire isEmptySquare to zero at the time of initialisation, then i'd suggest doing this instead:
int isEmptySquare[39][39] = { 0 };
This sets the entire array (not just one element) to zero.
If you need to reset it to zero later on, then you'll need to do it in some other way, such as std::fill()
Also, your comment suggests you've used a global variable. I'd strongly suggest you avoid using globals for all the trouble it will likely cause you later on when you have globally visible/modifiable data.
The fact remains that you cannot assign data to entire arrays using assignment, you can only do it at the time of initialisation. (or you can assign individual values one-at-a-time)
Will the data ever change? if its a lookup table you could dump the data into the whole thing at initialisation time. e.g.
its static, so i'll probably do that. I just tried the other way because a friend of mine managed to do it. He is using linux and gpp to compile and I'm using visual c++, could that make any difference?
and, another thing, now i tried to initialize de array, but now it was inside of a class, and it returned an error. How to initizalise t inside the class?