pointed object lost its field
<p>I am trying to construct a simple linked list, using a pointer pointing to the next insertion location, and add a node one by one.</p>

<pre><code>Tnode* NULL_cp = 0;
struct Tnode{
 string word;
 Tnode* left;
 Tnode* right;
};


int main(int argc, char** argv){
 int n = 0;
 Tnode head;
 head.word = "the head";
 head.left = NULL_cp;
 head.right = NULL_cp;
 Tnode* insertP = &amp;head;
 while(n&lt;argc-1){
  Tnode node;
  node.word = argv[n+1];
  node.left = insertP;
  node.right = NULL_cp;
  insertP-&gt;right = &amp;node;
  insertP = &amp;node;
  cout &lt;&lt; "inside loop: " &lt;&lt; insertP-&gt;word &lt;&lt;  endl;
  n++;
 }
 cout &lt;&lt; "outside loop: the word is " &lt;&lt; insertP-&gt;word &lt;&lt; endl;
}
</code></pre>

<p>the output is</p>

<pre><code>inside loop: hello
outside loop: the word is
</code></pre>

<p>if I typed in <strong><em>a.out hello</em></strong>. the part that confused me is that after one loop, the insertP should be pointing at the newly inserted node that has the the word <strong><em>hello</em></strong>, but it printed out nothing even though inside the loop it printed out <strong><em>hello</em></strong>, any idea why? Thank you very much </p>
