title: concatenate macros in c in a loop
body: <p>i want to concatenate a lot of macros in order to pass them as parameter in a struck array. to be more specific i have this struct </p>
  
  <pre><code>static struct
  {
   unsigned int num_irqs;
   volatile __int_handler *_int_line_handler_table;
  }_int_handler_table[INTR_GROUPS];
  </code></pre>
  
  <p>and I want to pass as <code>num_irqs</code> parameter a series of macros </p>
  
  <pre><code>AVR32_INTC_NUM_IRQS_PER_GRP1
  
  AVR32_INTC_NUM_IRQS_PER_GRP2
  ...
  </code></pre>
  
  <p>first I thought to use this code </p>
  
  <pre><code>for (int i=0;i&lt;INTR_GROUPS;i++)
  {
     _int_handler_table[i].num_irqs = TPASTE2(AVR32_INTC_NUM_IRQS_PER_GRP,i); 
  }
  </code></pre>
  
  <p>but it takes the <code>i</code> as <code>char</code> and not the specific value each time. I saw also that there is a <code>MREPEAT</code> macro defined in the preprocessor.h but I do not understand how it is used from the examples.</p>
  
  <p>Can anyone can explain the use of <code>MREPEAT</code> or another way to do the above.</p>