title: Argc returning as 1, argv returning NULL, despite putting in command line arguments
body: <p>I suppose I'm a little rusty on C command line arguments. I looked at some old code of mine, but no matter what this version keeps segfaulting. </p>
  
  <p>The way this would be ran is ./foo -n num (where num is the number the user inputs in the command line)</p>
  
  <p>But somehow it isn't working. Where do I go wrong?</p>
  
  <p>EDIT: It's segfaulting when I try to access atoi(optarg) which is atoi(0x0) which segfaults. </p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      int c;
      int maximum_n = max_n(); /* Stores the maximum value in the sequence a long can hold */
      unsigned long *array = NULL;
  
      while((c = getopt(argc, argv, ":n:")) != -1) {
  
          switch(c) {
          case 'n':
              if(atoi(optarg) &gt; maximum_n) {
                  printf("n is too large -- overflow will occur\n");
                  printf("the largest Fibonacci term than can be calculated is %d\n", maximum_n); 
                  exit(EXIT_SUCCESS);
              }
              else {
                  array = fib_array(atoi(optarg));
              }
              break;
          }   
      }
  
      printf("The %d Fibonacci term is %lu\n", atoi(optarg), array[atoi(optarg)]);
  
      return 0;
  }
  </code></pre>