title: Linked List: What does (!elem) mean and (!(elem = *stack)) in the following code?
body: <pre><code>typedef struct Element 
  {
      struct Element *next;
      void *data;
  } Element;
  </code></pre>
  
  <p>In the pop function, what does the line (!(elem = *stack)) mean? </p>
  
  <pre><code>bool pop( Element **stack, void **data )
  {
      Element *elem;
      if (!(elem = *stack)) return false;
  
      *data = elem-&gt;data;
      *stack = elem-&gt;next;
      delete elem;
      return true;
  }
  </code></pre>
  
  <p>In the push function, what does the line (!elem) mean?</p>
  
  <pre><code>bool push( Element **stack, void *data )
  {
      Element *elem = new Element;
      if(!elem) return false;
  
      elem-&gt;data = data;
      elem-&gt;next = *stack;
      *stack = elem;
      return true;
  } 
  </code></pre>