C++  function using reference as param error
<pre><code>struct node {

  string info;
  node *next;

  node() {
   info = "string";
   next = NULL;

  }

};

void insert(node &amp;anode) {
 node newNode;
 anode.next = &amp;newNode;
}
</code></pre>

<p>What is wrong with this implementation of insert for this structure ? How should I fix this?
<strong>added:</strong> Very sorry that I wasn't clear. I know what is wrong with the program. I want to know how I can insert a new node to a reference node. Since I am using a reference to a node as a param this mean that node must not be a pointer? So its stored on stack? which means I can't use memory from heap? (or else seg fault?) so how am I suppose to use new ? This is my main confusion. Perhaps my approach is wrong but I don't see why it should be.</p>
