title: Why using & to point to Struct s not correct in C++( on Mac)?
body: <p>I Use this code to add Node in the linked list's tail.
  But it's not correctly running.</p>
  <pre><code>truct Node {
      int value;
      Node *next;
      Node() {
      }
  
      Node(int i):value(i),next(NULL){
      }
  };
  
  void addNode(Node **list, int i) {
      if (!list ||!*list) {
          return;
      }
      Node *n = *list;
      Node *cur = n;
      Node *tailP = NULL;
      
      while(cur) {
          tailP = cur;
          cur = cur-&gt;next;
      }
  
      Node iNode = Node(i); // I first create a Node struct.
      Node *node = &amp;iNode;
      tailP-&gt;next = node;
  }
  </code></pre>
  <p>After I changed the function to the following, It's true now.</p>
  <pre><code>void addNode(Node **list, int i) {
      if (!list ||!*list) {
          return;
      }
      Node *n = *list;
      Node *cur = n;
      Node *tailP = NULL;
      
      while(cur) {
          tailP = cur;
          cur = cur-&gt;next;
      }
  
      Node *node = new Node(i); // Now I use new to create a Struct Node.
      tailP-&gt;next = node;
  }
  </code></pre>
  <p>So I'm wondering what's going on? Thanks for your attention.</p>