title: How to call a function in another C file with a subset of the command-line arguments?
body: <p>How can I call this <code>convert</code> function using command line and from argument 2 onwards start converting the strings to int and store in an array?</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main (int argc , char* argv[])
  {
      int i;
   
      if (argc &lt; 2)
  
      {
          printf(&quot;Error: Less than two arguments\n&quot;);
      }
      else 
      {
          for(i=0; i&lt;argc; i++)
          {
              printf(&quot;[%d] : %s\n&quot;, i , argv[i]); 
          }
      }
      return 0;
  } 
  </code></pre>
  <p>Function in the same directory but in a separate C file:</p>
  <pre><code>void convert ( char* parray[] ,int array[] )
  {   
      int i;
   
      printf(&quot;The converted array = &quot;);
  
      for (i=0; i&lt; LENGTH; i++)
      {
          array[i] = atoi(parray[i]);
  
          printf(&quot; %d&quot; , array[i]);
      }
      printf(&quot;\n&quot;);
  }
  </code></pre>