title: C++: Return NULL instead of struct
body: <p>I have a struct <code>Foo</code>. In pseudocode:</p>
  
  <pre><code>def FindFoo:
     foo = results of search
     foundFoo = true if a valid foo has been found  
  
     return foo if foundFoo else someErrorCode
  </code></pre>
  
  <p>How can I accomplish this in C++? </p>
  
  <p><strong>Edited</strong> to remove numerous inaccuracies. </p>