• Create a directory named ``pup1'' under your home directory.
    The pup1 directory must contain
    • Makefile
    • main.c
      (Or you can copy it from Textbook on page 20, but change prototype of makeargv to
      #include "argvlib.h".)
    • argvlib.c
      The C program contains your implementation of makeargv(). DO NOT use strtok() family functions in your code.
    • argvlib.h
      Contains the prototype for makeargv().
  • When type ``make'' in your pup1 directory, an executable named ``argvtest'' must be generated.
  • Due day, 3/12 11:59pm
  •  
       The prototype of makeargv() is 
       int makeargv(const char *s, const char *delimiters, char ***argvp); 
    
       Example: 
         char *string = "this is a test";
         char *delimiters = " ";
         char **fields;
         int  numOfTokens;
    
         numOfTokens = makeargv(string, delimiters, &fields);
    
      The makeargv() separates the string into tokens where delimiters are 
      passed in second argument.
      makeargv() does not change the original string and delimiters and 
      will allocate memory for the third argument which is returned as the
      parsing result. In the example, after the invokation of makeargv(),
      fields[0] should be "this" and  fields[1] = "is" .....
      The return value is the number of tokes found.  The return value of 
      above example should be 4.  If any error were found, return -1.