title: Return pointer from function to main
body: <p>I want to return a pointer value to my main function but it works only locally and the value of root = NULL remains the same outside the function insert.</p>
  
  <pre><code>   node *insert(int number,   node *root ){
  
  
  
          if(root==NULL){
              root = new node;
              root-&gt;key = number;
              printf("%d", number);
              return root;
          } }
  </code></pre>