Comparing a pointer with integer
<p>I am making a binary search tree program and I want to traverse to the node whose left or right child is to be selected for inserting the element. Whereas in the while condition I am getting warning of comparison of pointer with integer. Help me</p>

<pre><code> while(temp1-&gt;data != NULL)
   {
       temp2=temp1;
       if(value&lt;=temp1-&gt;data)
       {
           temp1=temp1-&gt;lchild;
       }
       else
       {
           temp1=temp1-&gt;rchild;
       }
   }
</code></pre>