This only barely works (ignoring the lack of an entry point) because x is uninitialized. '==' is equality comparison, not assignment. The break clause is completely unnecessary as well, since it is at the end of the code block, and only gets executed when the loop would have ended in the first place.
Something cleaner:
Code:
#include <iostream>
int main (int argc, char* argv[]) {
for( int i = 0; i < 100; ++i ) {
std::cout << i << std::endl;
}
return 0;
}
With some more fidgeting, you could supply via command-line argument a beginning and limit value.
Good luck with the learning process.