title: Compilation Error: void value not ignored as it ought to be in std::queue::pop()
body: <p>Write a function to connect all the adjacent nodes at the same level in a binary tree. Structure of the given Binary Tree node is like following.</p>
  
  <pre><code>struct Node{
    int data;
    Node* left;
    Node* right;
    Node* nextRight; 
  }
  </code></pre>
  
  <p>Initially, all the <code>nextRight</code> pointers point to garbage values. Your function should set these pointers to point next right for each node.</p>
  
  <p>My code is </p>
  
  <pre><code>#include&lt;queue&gt;
  /*
  Please note that it's Function problem i.e.
  you need to write your solution in the form of Function(s) only.
  Driver Code to call/invoke your function would be added by GfG's Online Judge.*/
  
  
  /* struct Node
  {
    int data;
    Node *left,  *right;
    Node *nextRight;  // This has garbage value in input trees
  }; */
  // Should set the nextRight for all nodes
  void connect(Node *p)
  {
     Node *temp=p;
     queue&lt;Node *&gt; q;
     Node *pp=NULL;
     q.push(p);
     q.push(pp);
     while(q.empty()==false)
     {
         Node* nn=q.pop(); //  &lt;---------- Error appears here
         Node* conn=NULL;
         if(nn!=NULL)
         {
             conn=q.front();
             nn-&gt;nextRight=conn;
             if(nn-&gt;left!=NULL)
                 q.push(nn-&gt;left);
             if(nn-&gt;right!=NULL)
                 q.push(nn-&gt;right);
         }
         else if(q.empty()==false)
         {
             q.push(pp);
         }
  
     }
  
  }
  </code></pre>
  
  <p>It gives this error:</p>
  
  <pre><code>Compilation Error... 
  prog.cpp: In function 'void connect(Node*)':
  prog.cpp:120:23: error: void value not ignored as it ought to be
          Node* nn=q.pop();
                         ^
  </code></pre>
  
  <p>Help me to run the code without this error.</p>