title: How to pass arguments from terminal to a function
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/498320/pass-arguments-into-c-program-from-command-line">Pass arguments into C program from command line</a>  </p>
  </blockquote>
  
  
  
  <p>I am trying to pass three arguments from terminal into a function called replace. I would like to know if it is possible to do the following from terminal</p>
  
  <pre><code>  % ./replace d DDD mytest.tx
  </code></pre>
  
  <p>I have looked online but can only find information on passing values directly to main() and not the function inside.  </p>
  
  <p>Edit: I have edited the main functions as following:</p>
  
  <pre><code>void replace(char* string_a, char* string_b, char* string_f)
   {
    }
  
  int main(int argc, char *argv[])
    { 
         if(argc &lt; 4)
    { 
      printf("Not enough arguments\n");
     return 0;
    }
  
  replace(argv[1],argv[2],argv[3]);
   }
  </code></pre>