title: Moving an object over a grid in C
body: <p>My program created a grid which looks like this</p>
  
  <pre><code>- - - 
  - - - 
  - - -
  </code></pre>
  
  <p>I need to print an object over this grid, and this object needs to move around the grid. I need to place this object at random coords, before moving it.
  For example:</p>
  
  <pre><code>- - -    - - -    - X -
  X - - -&gt; - X - -&gt; - - -
  - - -    - - -    - - -
  </code></pre>
  
  <p>I managed to  create the grid using a multi dimensional array but i don't know how to place the object on it. I thought of adding a line to place it "manually" right into the array, like that: <code>field[1][1] = 'X'</code> but obviously it's not going to work, since the array it's <code>int</code>, i'm thinking of doing it using pointers, any advice on how i could do that?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #define GRID_WIDTH 3
  #define GRID_HEIGHT 3
  
  void view_grid(int field[GRID_WIDTH][GRID_HEIGHT]){
      int i,j;
  
      for (i=0;i&lt;GRID_WIDTH;i++) {
          for (j=0;j&lt;GRID_HEIGHT;j++) {
              printf("- ");
  
          }
          printf("\n");      
      }
  }
  
  int main() {
      int field[GRID_WIDTH][GRID_HEIGHT];
      view_grid(field);
  
  }
  </code></pre>