title: multiple input parameters from command line in C
body: <p>I am trying to pass multiple parameters when running a compiled C code </p>
  
  <p>code would be like this </p>
  
  <pre><code>void main(char argc,char *argv[]){
  
      printf("%s",argv[1])    //filename
      FILE *file = fopen(argv[1], "r")
  
      printf("%s",argv[2])    //function to be called
      char* func_name = argv[2];
  
      printf("%s",argv[3])    //how many times the function is called
      int repeat = argv[3];
  
      for(int i=0;i&lt;repeat;i++){
          func_name(file) //calls some function and passes the file to it 
      }
  </code></pre>
  
  <p>}</p>
  
  <p>i would compile like this</p>
  
  <pre><code>gcc cprog.c -o cprog
  </code></pre>
  
  <p>run like -</p>
  
  <pre><code>./cprog textfile.txt function1 4 
  </code></pre>
  
  <p>how do i do this ? any help would be appreciated ! </p>