title: General rule: negative or positive values for error code in C/C++
body: <p>I have my own return type and functions defined like this:</p>
  
  <pre><code>typedef enum xx_return_t {
     success = 0,
     general_error = -1,
     specific_error = -2,
     [...]
  } xx_return_type;
  
  xx_return_type generalFunction(void) {
     if(there_was_an_error)
        return general_error;
  }
  </code></pre>
  
  <p>However I'm a bit uncertain on the error type values here;
  <strong>what is standard/best practice for values of error returns in C/C++ - <em>negative or positive</em>?</strong></p>
  
  <p><em>Update:</em>
  Thank you for your answers!
  I was looking for info on both C and C++, but I also realize this raises good questions on general structure and methods specific to each language (exceptions, error codes, object returns, etc).</p>