title: returning a 2D arrray in c++
body: <p>I recentley started coding in C++ and I can't seem to understand how to ruturn the 2d array </p>
  
  <blockquote>
    <p>GridArray</p>
  </blockquote>
  
  <p>Is the problem somewhere in the type of the method because I can't seem to resolve it. Any help would be much appriciated!</p>
  
  <pre><code>static int GridArray [15][20];
  
  int MapEditor::updateGrid(int *xCursor,int *yCursor){`
      int width=16;
  
      if(input.getInput()==psxUp){
          VGA.drawRect((*xCursor)*16,(*yCursor)*16,(*xCursor)*16+width,(*yCursor)*16+width,255 );
  
          (*yCursor)--;
          if((*yCursor)&lt;=0){
              (*yCursor)=15;
          }
          VGA.drawRect((*xCursor)*16,(*yCursor)*16,(*xCursor)*16+width,(*yCursor)*16+width,224 );
      }
      if(input.getInput()==psxLeft){
          VGA.drawRect((*xCursor)*16,(*yCursor)*16,(*xCursor)*16+width,(*yCursor)*16+width,255 );
  
          (*xCursor)--;
          if((*xCursor)&lt;=0){
              (*xCursor)=20;
          }
          VGA.drawRect((*xCursor)*16,(*yCursor)*16,(*xCursor)*16+width,(*yCursor)*16+width,224 );
      }
  
      if(input.getInput()==psxRight){
          VGA.drawRect((*xCursor)*16,(*yCursor)*16,(*xCursor)*16+width,(*yCursor)*16+width,255 );
  
          (*xCursor)++;
          if((*xCursor)&gt;=20){
              (*xCursor)=0;
          }
          VGA.drawRect((*xCursor)*16,(*yCursor)*16,(*xCursor)*16+width,(*yCursor)*16+width,224 );
      }
      if(input.getInput()==psxDown){
          VGA.drawRect((*xCursor)*16,(*yCursor)*16,(*xCursor)*16+width,(*yCursor)*16+width,255 );
  
          (*yCursor)++;
          if((*yCursor)&gt;=15){
              (*yCursor)=0;
          }
          VGA.drawRect((*xCursor)*16,(*yCursor)*16,(*xCursor)*16+width,(*yCursor)*16+width,224 );
      }
      if(input.getInput()==psxSqu){
          spriteSelector.setSprite(bricks_destructive,bricks_destructive_palette);
          spriteSelector.drawAtPosition((*xCursor)*16,(*yCursor)*16);
          spriteSelector.update();
          GridArray[(*yCursor)][(*xCursor)]=1;
          Serial.println(GridArray[(*yCursor)][(*xCursor)]);
      }
      delay(120);
      if(input.getInput()==psxSlct){
          Serial.println(GridArray);
          return GridArray;
      }
  }
  </code></pre>