title: Trying to create a better loop for naming array elements
body: <p>I have started studying arrays and have just started making some practice but I am having some problems with using loops to name the elements inside of a specific array.</p>
  
  <p>I was trying to make this piece of code that assigned the numbers from 1 up to 12(to resemble the months of the year) to the ints inside of the array, this is what I came up with:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
  int array[12];
  
  for (int i = 0; i &lt; 12;) {
      cout &lt;&lt; "Month number " &lt;&lt; i + 1 &lt;&lt; endl;
      array[i] = (i++);
  }
  
  return 0;
  }
  </code></pre>
  
  <p>What I don't like about this is the fact that I had to leave the increment/decrement space inside of the for loop empty. I had initially tried making the code look something like this:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
  int array[12];
  
  for (int i = 0; i &lt; 12; i++) {
      cout &lt;&lt; "Month number " &lt;&lt; i + 1 &lt;&lt; endl;
      array[i] = i++;
  }
  
  return 0;
  }
  </code></pre>
  
  <p>But this way, even if the first element of the array came out correct, the subsequent ones didn't. I think the reason for this is that the i++ in the last statement of the loop makes the value of i increment but I couldn't find a way around it without having to add another line with i-- or doing as I did in the first code I posted.</p>
  
  <p>Could anyone offer me a hand in understanding how to make it so that i can store the value of i, incremented by one, inside of that specific array element, without incrementing it for the whole loop(if it is possible)?</p>
  
  <p>I know there are ways around it, just like I showed in the first code i posted, but it's something that's bugging me and so I would like to make it more visually pleasing.</p>
  
  <p>Please, keep in mind that I am just a beginner :)
  Thanks in advance for the answers, and sorry for the long question.</p>
  
  <p>Edit: Apparently, coding like this:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      int array[12];
  
      for (int i = 0; i &lt; 12; i++) {
          cout &lt;&lt; "Month number " &lt;&lt; i + 1 &lt;&lt; endl;
          array[i] = i + 1;
      }
      cout &lt;&lt; array[4] &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>makes it so that the program works correctly and looks like I wanted, but I can't comprehend why it does :(</p>
  
  <p>Edit 2: Apparently, as UnholySheep pointed out, I missed on the fact that + 1 does not modify the value of the integer, while ++ does. 
  Thanks to everyone that answered and explained how ++ and +1 work!</p>