Trouble with the for loop

Hello :)
currentely learning c++ (on vc++ 2010 express ed.)
but having a little problem with the for loop.

My Code:

#include <iostream>
using namespace std;

int main ()
{
int i;

for (i=0 , i<=10 , ++i)
cout << i;
system ("pause");
return 0;
}



VC++ only accepts it when it's like this :

#include <iostream>
using namespace std;

int main ()
{
int i;

for (i=0 , i<=10 , ++i;;)
cout << i;
system ("pause");
return 0;
}


(requires ;; after the ++i)
The first one should cout 12345678910
but 'cause vc++ doesn't accept it and wants the ;; to be added , it actually
spawns 1111111111111111111111... then.

Please tell me what I did wrong, 'cause really can't find it .

Tx on advance :)
cplusplus.com has a great tutorial. Here is a link to the page that will help. http://www.cplusplus.com/doc/tutorial/control/

Aah, my apologies for asking such a dumb question :D, didn't notice that inside a for loop " ; " are being used instead of " , ".
Though I wouldn't have mind if you just said so :p.

Aah well , tx :D
Don't get in the habit of using system(). -heads up-
sry , just read in another topic that it's appearentely making trouble with some virus scanners or smth, but for mere learning app's , I suppose I can live with it for now :)
Topic archived. No new replies allowed.