x++ in that case is equivalent to x = x + 1.
In context of being alone, like as you have it in a for loop, ++x and x++ are the same. In context of being used in an expression ++x increments the value of x immediately. x++, on the other hand, increments the value of x, but the original value is used in its place:
Case in point:
Code:
int x = 3;
std::cout << "x = " << x++ << std::endl;
Printed value will be 3, however, x itself will be 4.
Code:
int x = 3;
std::cout << "x = " << ++x << std::endl;
Printed value will match x, which will be 4.