title: making a dynamic queue in C++
body: <p>I'm trying to make a dynamic <strong>queue</strong> in C++ and I wrote most of the code, yet it doesn't work, could someone be kind enough to look through it and tell me what's wrong? :)
  Also please comment on the coding style I wish to improve.</p>
  
  <p>I wrote a main function to test the program and this should be the expected result:</p>
  
  <p>data1=1</p>
  
  <p>data1=1 data2=2</p>
  
  <p>1 2 3 4 5 6</p>
  
  <p>Del:1 Del:2 Del:3</p>
  
  <h2>This is my code:</h2>
  
  <pre><code>#include &lt;iostream&gt;
  template&lt;typename T&gt;
  class Queue
  {
      struct Node
      {
          T data;
          Node* next;
      };
      Node* head;
      Node* tail;
      int qsize;
  
  public:
      Queue()
      {
          head = NULL;
          tail = NULL;
          qsize = 0;
      }
  
      bool empty()
      {
          if(qsize = 0){return true;}
          else         {return false;}
      }
  
      void put(const T&amp; data)
      {    
          Node *newNode = new Node;
          if(qsize)
          {
              tail-&gt;next = newNode;
              newNode-&gt;data = data;
              newNode-&gt;next = NULL;
              tail = newNode;
          }
          else
          {
              head = tail = newNode;
              newNode-&gt;data = data;
              newNode-&gt;next = NULL;
          }
          qsize++;
      }
  
      T get()
      {
          T val;
          Node *temp;
  
          if(empty())
          {
              std::cout &lt;&lt; "queue is empty" &lt;&lt; std::endl;
          }
          else
          {
              val = head-&gt;data;
              temp = head;
              head = head-&gt;next;
              delete temp;
  
              qsize--;
              return val;
          }
      }
  
      void destroyQueue()
      {
          while(!empty())
          {
              std::cout&lt;&lt;"DEL:";
              get();
          }
      }
  
      ~Queue()
      {
          destroyQueue();
      }
  };
  
  
  
  int main()
  {
      int data1,data2;
      Queue&lt;int&gt;* q = new Queue&lt;int&gt;();
      q-&gt;put(1);
      data1 = q-&gt;get();
      std::cout &lt;&lt; " data1=" &lt;&lt; data1 &lt;&lt; std::endl;
      q-&gt;put(1);
      q-&gt;put(2);
      data1 = q-&gt;get();
      data2 = q-&gt;get();
      std::cout &lt;&lt; " data1=" &lt;&lt; data1
                &lt;&lt; " data2=" &lt;&lt; data2 &lt;&lt; std::endl;
      q-&gt;put(1);
      q-&gt;put(2);
      q-&gt;put(3);
      q-&gt;put(4);
      q-&gt;put(5);
      q-&gt;put(6);
      while (!q-&gt;empty()) std::cout &lt;&lt; " " &lt;&lt; q-&gt;get();
      std::cout &lt;&lt; std::endl;
      q-&gt;put(1);
      q-&gt;put(2);
      q-&gt;put(3);
      delete q;
  }
  </code></pre>