title: Deep copy of struct C++
body: <p>Say I have a struct:</p>
  
  <pre><code>struct TrieNode {
  const NumChars = 26;
  bool isWord;
  int letterCount;
  TrieNode *letters[NumChars];
  
  TrieNode() {
      isWord = false;
      for ( int i = 0; i &lt; NumChars; i += 1 ) {
          letters[i] = NULL;
      } // for
      letterCount = 0;
   }
  };
  </code></pre>
  
  <p>I create a TrieNode on the heap like this:</p>
  
  <pre><code>TrieNode *root = new TrieNode();
  </code></pre>
  
  <p>Now how can I create a different copy of root? (deep copy)</p>