title: C scanf() problem
body: <p>Im new to C and cant for the life of me work out what im doing wrong here. The first scanf works fine, variables are printed out as they are read in. The second scanf doesn't seem to be reading the input correctly. Input is of the format "char int int" i.e. b 4 4<br>
  when i print opb x and y out, opb = " ", x = 13238272 , y=0. 
  Any Ideas?.....note ive cut out code below the problem</p>
  
  <pre><code>int main(void)
  {
  
  /*initialize variables*/
  int width, height;
  char op;
  
  /*grid input*/
  scanf("%c %d %d", &amp;op, &amp;width, &amp;height);
  
  /*check conditions*/
  if (op != 'g' || width&gt;100 || height&gt;100 || width*height&lt;10 || width&lt;1 || height&lt;1) {
      printf("grid-error\n");
      return 0;
  }
  
  /*initialize grid elements*/
  int grid[width][height];
  char printGrid[width][height];
  
  /*create grid elements*/
  int i, j;
  for (i=0; i&lt;height; i++) {
      for (j=0; j&lt;width; j++) {
          grid[j][i] = 0;
          printGrid[j][i] = '*';
      }
  }
  
  /*print successful creation*/
  printf("%c %d %d \n", op, width, height);
  
  int k;
  for (k = 0; k&lt;10; k++) {
      /*initialize variables*/
      int x, y;
      char opb;
  
      /*mine input*/
      scanf("%c %d %d", &amp;opb, &amp;x, &amp;y);
  
      /*check conditions*/
      if (opb != 'b' || x&lt;0 || y&lt;0 || x&gt;(width-1) || y&gt;(height-1) || grid[x][y] == 9) {
          printf("mine-error\n");
          return 0;
      }
  </code></pre>