title: Creating new nodes in a trie data structure in C
body: <p>I'm trying to implement a trie data structure in <code>C</code> and having trouble figuring out how to dynamically name new nodes that are added to the dictionary. See the last few lines of my <code>add</code> method where I try to create a new node and try to point to it.</p>
  
  <pre><code>bool add(char *word, node tree)
  {
      // Creates a variable to store the current char in the string
      char currChar = word[0];
      // Converts the current char to an index #
      int currCharIndex = ((int) toupper(currChar)) - 65;
  
      // Checks if we've reached the end of the word
      if (currChar == '\0')
      {
          // Sets current node word to true
          tree.word = true;
      }
      // Checks if next letter in word is not NULL
      else if (tree.children[currCharIndex] != NULL)
      {
          // Follows the pointer
          return add(&amp;word[1], *tree.children[currCharIndex],);
      }
      else
      {
          //Creates a new node
          node; // TODO: name node
          // Points the current node to the new node
          tree.children[currCharIndex] = &amp;// TODO: new node name
          return add(&amp;word[1], *tree.children[currCharIndex]);
      }
  }
  </code></pre>
  
  <p>Here is how I define <code>node</code>:</p>
  
  <pre><code>typedef struct node
  {
      bool word;
      struct node *children[26];
  }
  node;
  
  bool search(char *word, node tree);
  bool add(char *word, node tree);
  
  int main(void)
  {
      node dictionary;
  }
  </code></pre>