title: How do i increment statement or decrement statement in C?
body: <p>There are actually two ways i can do this. One is to use the increment operator ++ and decrement operator –. For example, the statement “x++” means to increment the value of x by 1. Likewise, the statement “x –” means to decrement the value of x by 1. Another way of writing increment statements is to use the conventional + plus sign or – minus sign. In the case of “x++”, another way to write it is “x = x +1″.</p>
  
  <p>But why am i incrementing like this in my code and what does it mean? </p>
  
  <pre><code>    for(i=0; i &lt; numberOfProducts; ++i){
  
              printf("Enter Product Name: ");
  
  
              scanf("%s", &amp;(pProducts+i)-&gt;productName);
  
              printf("Enter Product Price: ");
  
              scanf("%f", &amp;(pProducts+i)-&gt;price);
  
  
  
  }
  </code></pre>
  
  <p>My question is why did i use ++i for it to work? i tried i++ but could not print.</p>