title: C: Avoid garbage values in linked-list
body: <p>Suppose a word has multiple meanings in the dictionary. Actually, In my dictionary, one node has 5 meanings. So when I lookup the word, the program prints 2 meanings along with other 3 garbage values 100 characters long. </p>
  
  <p>How can I avoid them from being printed?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>struct node{
      char word[20];
      char meaning[5][100];
      struct node *next;
  };
  void lookup(struct node *head, char *word)
  {
    int found = 0, i;
    while(head != NULL)
    {
      if(strcmp(head-&gt;word, word) == 0)
      {
          found = 1;
          printf("\n\t%s", word);
          for(i = 0; i &lt; 5; i++) printf("\n\t%s", head-&gt;meaning[i]);
          printf("\n");
          break;
      }
      head = head-&gt;next;
    }
    if(found == 0) printf("\nWord not found in the dictionary!!");
  }
  </code></pre>