/* example extracing a letter and number for a command-line argument */

#include <stdio.h>
#include <stdlib.h>

int main (int argc, char * argv[])
{
  if (argc < 2)
    printf ("need a command-line argument\n");
  else
    {
      printf ("need an argument to evaluate\n");
      char * firstparm = argv[1];
      char one = firstparm[0];
      printf ("the first parameter is %s\n", firstparm);
      printf ("the first character of the first parameter is %c\n", one);

      char * truncated = firstparm + 1;
      printf ("the truncated first parameter is %s\n", truncated);
      int firstnumber = atoi(truncated);
      printf ("twice the first number in truncated is:  %d\n",2*firstnumber);

    }
  return 0;
}
