title: How do mixed definitions work in enum?
body: <p>I am trying to use a C program (via dynamic libraries) with Python and the ctypes module. Several constants defined in a header file will be important for me, but I am unsure of how <code>enum</code> is being used to set their values.</p>
  
  <p>The obvious ones, I think I understand like:
  <code>enum{THING1, THING2, THING3};</code></p>
  
  <p><code>THING1=0, THING2=1, THING3=3</code></p>
  
  <p>But, what about this?
  <code>enum{THING1=-1, THING2, THING3};</code></p>
  
  <p>Is the result:
  <code>THING1=-1, THING2=1, THING3=2</code>?</p>
  
  <p>What about this one?
  <code>enum{THING1=1, THING2, THING3, THING4=-1}</code>?</p>
  
  <p>I don't have an easy way to test this, so hoping someone can explain the way <code>enum</code> works in this context. C books I looked in seemed to cover either the first case or the case where each value is explicitly defined, but not this mixed case.</p>
  
  <p>Many thanks in advance!</p>