title: Why segmentation fault (core dumped) when I reverse LinkList?
body: <p>i write a code slip, to reverse linklist.
  \
  but it cause segmentation fault,i don't know why??</p>
  
  <pre><code>  ListNode* ReverseList(ListNode* pHead) {
      ListNode *ptr_back, *ptr_cur, *tmp;
      ptr_cur = pHead;
      ptr_back = pHead-&gt;next;
      ptr_cur-&gt;next = NULL;
      while(ptr_back){
          tmp = ptr_back-&gt;next;
          ptr_back-&gt;next = ptr_cur;
          ptr_cur = ptr_back;
          ptr_back = tmp;
      }
      return ptr_cur;
  }
  </code></pre>