title: Segmentation Error : Command Arguments (argv)
body: <pre><code>#include&lt;stdio.h&gt;
  #include &lt;cs50.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;ctype.h&gt;
  int main(int argc, string argv[])
  {
    if (argc == 2)
    {
      printf (&quot;%s \n&quot;, argv[1]);
      
      if (isdigit (argv[1]) !=0)
       {
          printf(&quot;Success\n&quot;);
          printf(&quot;%s \n&quot;, argv[1]);
       }
      else
       {
          printf(&quot; %s key \n&quot;, argv[0]);
       }
    }
       else
       {
          printf(&quot; %s key \n&quot;, argv[0]);
       }
  
  }
  </code></pre>
  <p>Hello everyone, I am trying to run this program that takes command line arguments and checks them for digits.After that I have to store it into a variable. I am stuck and it is giving the error &quot;Segmentation fault&quot;. I googled it and I think it means that the program is not able to read the value. Please let me know why it is giving the error, what &quot;Segmentation fault&quot; means and how to fix it.</p>