title: Number placement in an "open" slot in a random coordinate
body: <p>I'm trying to set a random coordinate in a 6x15 array (map) to the number 3, but only if that coordinate's value is still 0. (All values within the array are initially set to 0, and ship num is the number of values of 3 I want to place)</p>
  
  <pre><code> 25 int shipnum;
   26 int x;
   27 
   28 shipnum = 1;
   29 while(shipnum &gt; 0)
   30 {
   31 if ((&amp;x = map[rand_number(MAX_ROWS)][rand_number(MAX_COLS)]) == 0)
   32 {*x = 3;
   33 shipnum --;}
   34 }
  </code></pre>
  
  <p>However, during compilation, I get the errors</p>
  
  <pre><code>testarray3.c:31:9: error: lvalue required as left operand of assignment
  testarray3.c:32:2: error: invalid type argument of unary ‘*’ (have ‘int’)
  </code></pre>
  
  <p>I'm not sure what either of these are saying... or is there a better way to do what I'm trying to do?</p>