Circular SIngly LInked LIst , ADDing a new node and displaing it
<p>Neither of the compilers I've used are able to debug it. I am trying to add a new node at the end of the list and then displaying it,,, they are not showing any sort of errors , both give a send dont send error by windows , I think this may be a memory leak..Please help me</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;conio.h&gt;
using namespace std;

struct Node
{
    int data;
    Node *nextptr;
};


class CLLIST{

private:
    Node*firstptr;
    Node*lastptr;

public:
     CLLIST(){

     cout &lt;&lt; "Constructor Called !";
      firstptr=lastptr=NULL;
}

 void insert_at_back(int val){
     cout &lt;&lt; " \n \n I am in the insert at back function: ";
     Node*newptr;
     newptr = new Node;
     newptr-&gt;data=val;

     if(firstptr=NULL)//means list is empty
     {
         firstptr=newptr;

     }else{
         lastptr-&gt;nextptr=newptr;
     }

     lastptr=newptr;
     lastptr-&gt;nextptr=firstptr;
 }

 void display(){

     Node *temptr,*endptr;
     temptr = new Node;
     endptr = new Node;

     temptr=firstptr;
     endptr = NULL;
     while(temptr!=endptr){

         cout &lt;&lt; "I am in the display Function: ";
         cout &lt;&lt; firstptr-&gt;data &lt;&lt; " ";
         firstptr=firstptr-&gt;nextptr;
         endptr=firstptr;}

         delete temptr;
         delete endptr;
     }


 };





 int main()
 {
 CLLIST obj1;




  obj1.insert_at_back(26);

  obj1.display();

 cout &lt;&lt; " \n \n Done !";

getch();
 }
</code></pre>
