title: Using hex values in array index in C
body: <p>I was reading through a C program which interfaces with hardware registers. The person has been using hexadecimal numbers as the index to an array such as :  </p>
  
  <pre><code>app_base_add[0x30]  
  </code></pre>
  
  <p>I know that a[i] means *(a+i) which is *(a+(i*sizeof(<em>typeof</em>(a)))) so a hexadecimal index is probably a offset of the desired memory location in the address space w.r.t app_base_add.  </p>
  
  <p>Is this right?<br>
  And also given , say :  </p>
  
  <pre><code>#define mm2s_start_add 0xc0000000;  
  </code></pre>
  
  <p>how would these assignments be different from each other in usage?  </p>
  
  <pre><code>volatile unsigned int *app_base_add;  
  app_base_add[0x30&gt;&gt;2]=0x1;    
  app_base_add[0x30&gt;&gt;2]=1&lt;&lt;2;  
  app_base_add[0x30&gt;&gt;2]=((unsigned int)mm2s_start_add);  //is this assignment valid??
  app_base_add[0x30&gt;&gt;2]=((unsigned int *)mm2s_start_add);
  </code></pre>