title: Exception thrown: read access violation this->pCurr was 0xDDDDDDDD
body: <p>I am a beginner and am working on linked list. I am trying to make a method that removes the current link of a list. I am getting an exception : read access violation this->pCurr was 0xDDDDDDDD.</p>
  
  <p>This is what my code looks like (I removed some methods, such as adding links and left only those related to removal)</p>
  
  <pre><code>template &lt;class T&gt;
  struct TNode {
      T val;
      TNode&lt;T&gt; *pNext;
  };
  template &lt;class T&gt;
  class TList {
  protected:
      TNode &lt;T&gt; *pFirst, *pLast, *pCurr, *pPrev, *pStop;
      int len; //lenght
      int pos;//where pCurr shows
  public:
      //constructor
      TList() {
          pFirst = NULL;
          pLast = NULL;
          pCurr = NULL;
          pPrev = NULL;
          pStop = NULL;
          len = 0;
          pos = 0;
      }
      //destructor
      ~TList() {
          TNode&lt;T&gt; *tmp = pFirst;
          //if (tmp == pStop)
              //delete tmp;
          while (pFirst != pStop) {
              pFirst = pFirst-&gt;pNext;
              delete tmp;
              tmp = pFirst;
          }
      }
      //delete first link
      void DelFirst() {
          T res = pFirst-&gt;val;
          TNode&lt;T&gt; *tmp;
          tmp = pFirst;
          pFirst = pFirst-&gt;pNext;
          delete tmp;
          len--;
      }
      //delete current link
      void DelCurr() {
          if (pCurr == pFirst)
              DelFirst();
          else {
              TNode&lt;T&gt; *tmp = pCurr;
              pPrev-&gt;pNext = pCurr-&gt;pNext; // an exception is thrown on this line
              pCurr = pCurr-&gt;pNext;
              delete tmp;
              len--;
          }
      }
      //set pCurr to the beginning
      void Reset() {
          pCurr = pFirst;
          pPrev = pStop;
          pos = 0;
      }
      //go to the next link
      void GoNext() {
          //if (IsEnd()) throw - 1;
          //else {
              pPrev = pCurr;
              pCurr = pCurr-&gt;pNext;
              pos++;
          //}
      }
      //end check
      bool IsEnd() {
          return (pCurr == pStop);
      }
      //delete the whole list
      void DelList() {
          for (Reset(); !IsEnd(); GoNext()) {
              DelCurr();
          }
          DelCurr();
      }
  };
  </code></pre>
  
  <p>Please tell me what this exception is related to and how to fix it.</p>