Minesweeper C++. Error, not an integer constant? [closed]











up vote
-4
down vote

favorite












I ran into these compilation errors when debugging my MineSweeper program



36  [Error]array bound is not an integer constant before ']' token
36 [Error] array bound is not an integer constant before ']' token
36 [Error] expected ')' before ',' token
36 [Error] expected unqualified-id before 'int'
64 [Error] array bound is not an integer constant before ']' token
64 [Error] array bound is not an integer constant before ']' token
64[Error] expected ')' before ',' token
64 [Error] expected unqualified-id before 'int'


MAXROWS and MAXCOLS are defined as follows:



int MAXROWS=10; // maximum possible row size
int MAXCOLS=15; // maximum possible column size


Lines 36 holds the declaration of this function:



// This is a graphics functions which create the graphics window.
void displayWindow (Cell cells[MAXROWS][MAXCOLS], int numRows, int numCols, int gameStatus);


Line 64 and its incimenting lines make up a function used to intiate the playing board



// This function initializes all the cells in the 2D minesweeper board.
void initBoard(Cell cells[MAXROWS][MAXCOLS], int numRows, int numCols) {
for(int row=0;row<numRows;rows++){
for(int col=0;col<numCols;col++){
cells[row][col]= createCell();
}}}


I've been looking at my code for hours and cant find the issue.Any suggestions?










share|improve this question













closed as off-topic by Snowhawk, Sᴀᴍ Onᴇᴌᴀ, πάντα ῥεῖ, Martin R, Heslacher Dec 1 at 10:10


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Snowhawk, Sᴀᴍ Onᴇᴌᴀ, πάντα ῥεῖ, Martin R, Heslacher

If this question can be reworded to fit the rules in the help center, please edit the question.

















    up vote
    -4
    down vote

    favorite












    I ran into these compilation errors when debugging my MineSweeper program



    36  [Error]array bound is not an integer constant before ']' token
    36 [Error] array bound is not an integer constant before ']' token
    36 [Error] expected ')' before ',' token
    36 [Error] expected unqualified-id before 'int'
    64 [Error] array bound is not an integer constant before ']' token
    64 [Error] array bound is not an integer constant before ']' token
    64[Error] expected ')' before ',' token
    64 [Error] expected unqualified-id before 'int'


    MAXROWS and MAXCOLS are defined as follows:



    int MAXROWS=10; // maximum possible row size
    int MAXCOLS=15; // maximum possible column size


    Lines 36 holds the declaration of this function:



    // This is a graphics functions which create the graphics window.
    void displayWindow (Cell cells[MAXROWS][MAXCOLS], int numRows, int numCols, int gameStatus);


    Line 64 and its incimenting lines make up a function used to intiate the playing board



    // This function initializes all the cells in the 2D minesweeper board.
    void initBoard(Cell cells[MAXROWS][MAXCOLS], int numRows, int numCols) {
    for(int row=0;row<numRows;rows++){
    for(int col=0;col<numCols;col++){
    cells[row][col]= createCell();
    }}}


    I've been looking at my code for hours and cant find the issue.Any suggestions?










    share|improve this question













    closed as off-topic by Snowhawk, Sᴀᴍ Onᴇᴌᴀ, πάντα ῥεῖ, Martin R, Heslacher Dec 1 at 10:10


    This question appears to be off-topic. The users who voted to close gave this specific reason:


    • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Snowhawk, Sᴀᴍ Onᴇᴌᴀ, πάντα ῥεῖ, Martin R, Heslacher

    If this question can be reworded to fit the rules in the help center, please edit the question.















      up vote
      -4
      down vote

      favorite









      up vote
      -4
      down vote

      favorite











      I ran into these compilation errors when debugging my MineSweeper program



      36  [Error]array bound is not an integer constant before ']' token
      36 [Error] array bound is not an integer constant before ']' token
      36 [Error] expected ')' before ',' token
      36 [Error] expected unqualified-id before 'int'
      64 [Error] array bound is not an integer constant before ']' token
      64 [Error] array bound is not an integer constant before ']' token
      64[Error] expected ')' before ',' token
      64 [Error] expected unqualified-id before 'int'


      MAXROWS and MAXCOLS are defined as follows:



      int MAXROWS=10; // maximum possible row size
      int MAXCOLS=15; // maximum possible column size


      Lines 36 holds the declaration of this function:



      // This is a graphics functions which create the graphics window.
      void displayWindow (Cell cells[MAXROWS][MAXCOLS], int numRows, int numCols, int gameStatus);


      Line 64 and its incimenting lines make up a function used to intiate the playing board



      // This function initializes all the cells in the 2D minesweeper board.
      void initBoard(Cell cells[MAXROWS][MAXCOLS], int numRows, int numCols) {
      for(int row=0;row<numRows;rows++){
      for(int col=0;col<numCols;col++){
      cells[row][col]= createCell();
      }}}


      I've been looking at my code for hours and cant find the issue.Any suggestions?










      share|improve this question













      I ran into these compilation errors when debugging my MineSweeper program



      36  [Error]array bound is not an integer constant before ']' token
      36 [Error] array bound is not an integer constant before ']' token
      36 [Error] expected ')' before ',' token
      36 [Error] expected unqualified-id before 'int'
      64 [Error] array bound is not an integer constant before ']' token
      64 [Error] array bound is not an integer constant before ']' token
      64[Error] expected ')' before ',' token
      64 [Error] expected unqualified-id before 'int'


      MAXROWS and MAXCOLS are defined as follows:



      int MAXROWS=10; // maximum possible row size
      int MAXCOLS=15; // maximum possible column size


      Lines 36 holds the declaration of this function:



      // This is a graphics functions which create the graphics window.
      void displayWindow (Cell cells[MAXROWS][MAXCOLS], int numRows, int numCols, int gameStatus);


      Line 64 and its incimenting lines make up a function used to intiate the playing board



      // This function initializes all the cells in the 2D minesweeper board.
      void initBoard(Cell cells[MAXROWS][MAXCOLS], int numRows, int numCols) {
      for(int row=0;row<numRows;rows++){
      for(int col=0;col<numCols;col++){
      cells[row][col]= createCell();
      }}}


      I've been looking at my code for hours and cant find the issue.Any suggestions?







      c++ c array error-handling matrix






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 1 at 7:25









      MR Nursurys

      1




      1




      closed as off-topic by Snowhawk, Sᴀᴍ Onᴇᴌᴀ, πάντα ῥεῖ, Martin R, Heslacher Dec 1 at 10:10


      This question appears to be off-topic. The users who voted to close gave this specific reason:


      • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Snowhawk, Sᴀᴍ Onᴇᴌᴀ, πάντα ῥεῖ, Martin R, Heslacher

      If this question can be reworded to fit the rules in the help center, please edit the question.




      closed as off-topic by Snowhawk, Sᴀᴍ Onᴇᴌᴀ, πάντα ῥεῖ, Martin R, Heslacher Dec 1 at 10:10


      This question appears to be off-topic. The users who voted to close gave this specific reason:


      • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – Snowhawk, Sᴀᴍ Onᴇᴌᴀ, πάντα ῥεῖ, Martin R, Heslacher

      If this question can be reworded to fit the rules in the help center, please edit the question.



























          active

          oldest

          votes






















          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes

          Popular posts from this blog

          Сан-Квентин

          Алькесар

          Josef Freinademetz