title: C++ index of define goes towards index initialization number
body: <p>I'm looking around the internet to see my problem. Either I can't see it or it does not exist. What I'm trying to do is I have a header file for a list of ids of items in my program. Now I wanted to make my life easier by having an index rather than having absolute numbers that whenever I change something I wouldn't have to rearrange everything again. </p>
  
  <p>Current code:</p>
  
  <pre><code>#define id1 1
  #define id2 2
  #define id3 3
  #define id4 4
  //times 100 more
  </code></pre>
  
  <p>Proposed code:</p>
  
  <pre><code>short index = 1;
  #define id1 index
  #define id2 index++
  #define id3 index++
  #define id4 index++
  </code></pre>
  
  <p>However printing the said code would give me a result of this</p>
  
  <pre><code>4
  3
  2
  1 
  </code></pre>
  
  <p>I'm weirded out by this. I see it going back towards the number that I initialized index with, which is one. I changed the <code>index++</code> to <code>index--</code> and the same result happened only that it now had negative values.</p>
  
  <pre><code>-2
  -1
  0
  1 
  </code></pre>
  
  <p>Is there a way to make it easier when I'm incrementing the index here? or is there something I'm missing out?</p>