title: C - String Linked List
body: <p>I need to take the following code, and modify it to accept strings as arguments, instead of ints.  In the end, I need the program to take all command line arguments, and add them to a linked list of strings.</p>
  
  <p>So if the input was six seven eight, when i printed the linked list, it would print: eight seven six.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct iNode
  {
      int myInt;
      struct iNode* next;
  } IntNode, *IntNodePtr;
  
  IntNodePtr insert(int i, IntNodePtr p)
  {
      IntNodePtr newp = malloc(sizeof(struct iNode));
      newp-&gt;myInt = i;
      newp-&gt;next = p;
      return newp;
  }
  
  printlist(IntNodePtr p)
  {
      if(p == NULL)
          printf("\n");
      else
      {
          printf("%d ", p-&gt;myInt);
          printlist(p-&gt;next);
      }
  }
  
  main(int argc, char* argv[])
  {
      int n = 5;
  
      if(argc &gt; 1)
      n = atoi(argv[1]);
  
      IntNodePtr iNodeList;
      iNodeList = NULL;
      int i = 0;
  
      while(i &lt; n)
      {
          iNodeList = insert(i++, iNodeList);
          printf("List is now: ");
          printlist(iNodeList);
      }
  }
  </code></pre>