Aug 24, 2013 at 9:03pm UTC
Line 29 - m and n are not const expressions. Some compilers allow non-const expressions, but c++ standard does not.
Line 45 - same issue.
Aug 24, 2013 at 11:10pm UTC
Thank you for replying. I know I can change the char array to be const char, but how do I fix the line 45 issue? Sorry for being dumb. I'm fairly new to programming.
Would that help with the errors I am getting?
Aug 25, 2013 at 3:03pm UTC
Looks to me like you need to do some bounds checking for "arrayNumeros".
e.g. line 59:
arrayNumeros [x - 1] [y - 1]++;
What happens here when x==0 && y==0?
Aug 25, 2013 at 8:38pm UTC
@AbstractionAnon Thank you, I made the changes allocating the arrays as worst case and it works fine now. I also had a silly error in the lines 62 & 63 where it was supposed to be Y instead of X, that was creating mistakes in the final results. It works perfectly now.
Thanks for the help!
Aug 25, 2013 at 10:29pm UTC
2 char * arrayBuscaminas;
arrayBuscaminas = new char[m][n];
This doesn't work. Did you mean
Last edited on
Aug 25, 2013 at 10:30pm UTC
Aug 26, 2013 at 1:41pm UTC
Yes, I meant