Question: I am assuming I am using this the wrong way, but the idea is for the command line argument to be the length of my fibonnaci serquence... however the way I am doing this, after 9 I am screwed... how can I resolve this issue?

```
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> /* for fork */
#include <sys/types.h> /* for pid_t */
#include <sys/wait.h> /* for wait */
int fibonacci(int n)
{
  int first = 0;
  int second = 1;
  int total, i;
  for (i=0;i<n;i++)
  {
    printf("%d\n", first);
    total = first + second;
    first = second;
    second = total;
  }
  return 0;
}
int main(int argc, char *argv[])
{
    /*Spawn a child to run the program.*/
    pid_t pid=fork();
    if (pid==0) { /* child process */
        if(*argv[1] == 45){
            printf("number invalid \n");
        }else{
            int number = *argv[1] - 48;
            fibonacci(number);
        }
    }
    else { /* pid!=0; parent process */
        waitpid(pid,0,0); /* wait for child to exit */
    }
    return 0;
}

```

Answer: 
Your way could be extended to handle more than one digit, but I think that what you're really looking for is `atoi()` or the non-deprecated [`strtol()`](http://linux.die.net/man/3/strtol).
get the argument like this:

```
int num = atoi(argv[1]);

```