title: Trouble adding string to LinkedList in C
body: <p>I want to add a string to a linked list in C. I was able to  figure out how to add a integer, so I thought adding a string wouldn't be much different. So I tried the following:</p>
  
  <pre><code>struct node{
     char val;
     struct node * next;
  };
  
  typedef struct node item;
  
  void linked_list(char letter[]) {
      item * curr, * head;
      int i;
  
      head = NULL;
  
      curr = (item *)malloc(sizeof(item));
      curr-&gt;val = letter;
      curr-&gt;next  = head;
      head = curr;     
  
      curr = head;
  
      while(curr) {
          printf("%s\n", curr-&gt;val);
          curr = curr-&gt;next ;
      }
  }
  </code></pre>
  
  <p>However, I keep getting an</p>
  
  <blockquote>
    <p>assignment makes integer from pointer without a cast</p>
  </blockquote>
  
  <p>warning and</p>
  
  <blockquote>
    <p>format '%s' expects type 'char *', but argument 2 has 'int'</p>
  </blockquote>
  
  <p>If, in the struct, val is a character, why am I getting this error?</p>
  
  <p>Side note: <code>char letter[]</code> is passing in letters/characters from a separate main method.  </p>
  
  <p>I am learning about C and linked lists from this tutorial:<a href="http://www.learn-c.org/en/Linked_lists" rel="nofollow">http://www.learn-c.org/en/Linked_lists</a>.</p>