title: Initialize enum variable in header
body: <p>I'm creating a new enum:</p>
  
  <pre><code>enum WState {SLEEPING=2, WAITING_FOR_DATA=3, SENDING=4, IDLE=5, ERROR=6};
  </code></pre>
  
  <p>Then I'm trying to initialize a variable of that enum type to a default state straight after.</p>
  
  <pre><code>WState CurrentState = WState::ERROR;
  </code></pre>
  
  <p>I can't figure out the correct syntax or maybe I'm missing some vital keywords when searching for an answer. It says: </p>
  
  <blockquote>
    <p>data member initializer not allowed</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/1iZgH.png" alt="enter image description here"></p>