title: Variable declaration after function's argument list
body: <p>I stumpled upon a C code, where variables seem to be declared after the argument list of a function. I did not know that this was possible. </p>
  
  <p>In the code, <code>int r</code> and <code>int *a</code> are declared right after the argument list of <code>arr2int</code>. How does this affect the local variables <code>a</code> and <code>r</code> of <code>arr2int</code>? </p>
  
  <p>The actual reason why I want to understand the code is because if I let it run on my linux x86 <code>a[1] = 1</code> at <code>//MARKER</code> when <code>arr2int</code> ist called the fist time. </p>
  
  <p>But if I let it run ona an ARM-based omap4 dev board <code>a[1]=0</code> and I dont know why there is a difference. </p>
  
  <p>Could someone comment on this please?</p>
  
  <pre><code>long arr2int(a,r)
  int r;
  int *a;
  {
     int i;
     long mul, result = 0, temp;
  
     //MARKER
     for (i=1; i&lt;=r; i++) {
        mul = 1;
        temp = a[i]-1;
        while (temp--)
           mul = mul &lt;&lt; 1;
        result += mul;
     }
     return(result);
  }
  </code></pre>
  
  <p>And the calling method:</p>
  
  <pre><code>void generateEncodingTable(){
      register int i,j;
      long temp;
      int seed = 133757;
  
      printf("\n[I] - Generating Encoding Table\n");
      for (pattern = 0; pattern &lt; 4096; pattern++) {
          temp = pattern &lt;&lt; 11;          /* multiply information by X^{11} */
          encoding_table[pattern] = temp + get_syndrome(temp);/* add redundancy */
      }
  
      decoding_table[0] = 0;
      decoding_table[1] = 1;
      temp = 1; 
      for (i=2; i&lt;= 23; i++) {
          temp *= 2;
          decoding_table[get_syndrome(temp)] = temp;
      }
  
      a[1] = 1; a[2] = 2;
  
      temp = arr2int(a,2);
      decoding_table[get_syndrome(temp)] = temp;
      for (i=1; i&lt;253; i++) {
          nextcomb(23,2,a);
          temp = arr2int(a,2);
      decoding_table[get_syndrome(temp)] = temp;
      }
  
      a[1] = 1; a[2] = 2; a[3] = 3;
      temp = arr2int(a,3);
      decoding_table[get_syndrome(temp)] = temp;
      for (i=1; i&lt;1771; i++) {
          nextcomb(23,3,a);
          temp = arr2int(a,3);
          decoding_table[get_syndrome(temp)] = temp;
      }
  }
  </code></pre>