Error in loop

I am stucking at a problem with the simplest code, im sure its something stupid. When i put a ';' after the main function, it says something along the lines of old style formatting listing. So when i remove it, it says there is a ';' missing before ')'. Any help would be appreciated, the code is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #include "stdafx.h"
#include <iostream>


using namespace std;


int _tmain(int argc, _TCHAR* argv[]) {

int i;

for (i = 0, i < 10, i++)
    cout << i << endl;


system("pause");
return 0;
}


this is all in visual studio express by the way, also putting {} for the for loop makes no difference to the outcome.
Look closely at line 12.

A for loop uses ; (semicolons), not , (commas)

http://www.cplusplus.com/doc/tutorial/control/
1
2
3
4
5
6
7
8
9
#include <iostream>
using namespace std;

int main(int argc, char* argv[])
{
for (int i = 0; i < 10; i++)
	{cout << i << endl;}
return 0;
}
Registered users can post here. Sign in or register to post.