title: How to define an enumerated type (enum) in C?
body: <p>I'm not sure what is the proper syntax for using C enums. I have the following code:</p>
  
  <pre><code>enum {RANDOM, IMMEDIATE, SEARCH} strategy;
  strategy = IMMEDIATE;
  </code></pre>
  
  <p>But this does not compile, with the following error:</p>
  
  <pre><code>error: conflicting types for ‘strategy’
  error: previous declaration of ‘strategy’ was here
  </code></pre>
  
  <p>What am I doing wrong?</p>