title: C program with command line options
body: <p>I wonder how to write a C program with options that can be invoked by a terminal.<br />
  Example : Person.c</p>
  <pre><code>#include &lt;stdio.h&gt;
  void main ()
  {
       char option;
  
       if(option == 'f') printf(&quot;First Name&quot;);
       else if(option == 'l') printf(&quot;Last Name&quot;);
       else printf(&quot;Full Name&quot;);
  }  
  </code></pre>
  <p>Compile it with</p>
  <blockquote>
  <p>cc Person.c -o Person</p>
  </blockquote>
  <p>Objective :<br />
  I want to reach my program options through terminal.<br />
  Example :</p>
  <pre><code>./Person -f
  </code></pre>
  <p>Output : First Name</p>