for(i=0; i < numberOfProducts; ++i)
and
for(i=0; i < numberOfProducts; i++)
are both equivalent as you are not reading the result of the operation (like in a = i++
vs a = ++i
). The latter form is more common.
If you have different results, you probably have issues in the way you are testing your program.
2
solved How do i increment statement or decrement statement in C? [closed]