rojart, both versions are a bit too "much", as expression you only need something that evaluates the whole time to true, eg. anything non 0.

Like:
Code:
function main(){
	int i;
	
	for (i = 0; 1; i++){
		printf("%i",i);
		if (i >= 10)
		break;
	}
}


(This is also what the C standard describes what a compiler should insert in the case a user leaves the field blank)

Edit: The loop will increase the iterator at the end of the loop, before evaluating the expression again. So your second code sample is completely wrong.

Last edited by JustSid; 02/11/11 22:11.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com