title: how to access 6 different functions within for loop in C?
body: <p>I am writing a code in C. I have to calculate some coefficients named as:</p>
  
  <pre><code>k1, k2, k3, k4
  </code></pre>
  
  <p>I have 6 different functions named as:</p>
  
  <pre><code>func1, func2, func3, .....func6
  </code></pre>
  
  <p>Very inefficient way is to write a code like this: </p>
  
  <pre><code>/* find k1 for all 6 functions */
  
  /* k[0][0] is k1 for func1 */
  /* k[0][1] is k1 for func2 */
     ......
     ......
  /* k[0][5] is k1 for func6 */
  
  /* h is some constant */
  
              k[0][0] = h*func1()
              k[0][1] = h*func2()
              k[0][2] = h*func3()
              k[0][3] = h*func4()
              k[0][4] = h*func5()
              k[0][5] = h*func6()
  </code></pre>
  
  <p>Similarly I have to find out k2 for all 6 functions.</p>
  
  <p>Again very inefficient way would be :</p>
  
  <pre><code>        k[1][0] = h*func1()
          k[1][1] = h*func2()
          k[1][2] = h*func3()
          k[1][3] = h*func4()
          k[1][4] = h*func5()
          k[1][5] = h*func6()
  </code></pre>
  
  <p>And similar things for remaining k3 &amp; k4 would be: </p>
  
  <pre><code> /* find K3 for all 6 functions */
     .............
     .............
   /* find K4 for all 6 functions */
     .............
     .............
  </code></pre>
  
  <p>I want to avoid all this.</p>
  
  <p>I want a way so that I can call 6 functions for each coefficient k within a <code>for</code> loop. Something like this: </p>
  
  <pre><code>for(i=0; i&lt;=3; i++)
    {
       for(j=0; j&lt;=5; j++)
         {
            k[i][j] =  h*func[...]
            /* where func[...] means some way for calling 6 functions */
         }
    }
  </code></pre>
  
  <p>May be some array of functions ??</p>
  
  <p>Any help will be highly appreciated.</p>
  
  <p>Thanks. </p>