title: i need a single function which replace func1,2,3,4,5 here
body: <pre><code>    struct setrate {
      int *rate;
      int numrate;
      }
  
  /*func1 assigned lev1 by f1 */
      func1(struct setrate *name, int lev1, int f1)
      {
      name-&gt;rate[lev1] = f1;
      }
  
  /*func1 assigned lev1 by f1 and lev2 by f2*/
      func2(struct setrate *name, int lev1, int f1, int lev2, int f2)
      {
      name-&gt;rate[lev1] = f1;
      name-&gt;rate[lev2] = f2;
      }
  /*func1 assigned lev1 by f1 and lev2 by f2 lev3 by f3*/
      func3(struct setrate *name, int lev1, int f1, int lev2, int f2, int lev3, int f3)
      {
      name-&gt;rate[lev1] = f1;
      name-&gt;rate[lev2] = f2;
      name-&gt;rate[lev3] = f3;
      }
  /* func4 and func5 */`enter code here`
      main()
      {
      struct setrate *name
  
      func1(name, 1, 10);
      func2(name, 1 10, 2, 20);
      func2(name, 1 10, 2, 20, 3, 30);
      func4()
      func5()
      }
  </code></pre>