Firstly, I use Visual Studio 2015, and I have already configured the openMP environment.(I promise it's right).
#pragma omp parallel for
for(int i= 0; i < 10; i++)
printf("%d ", i);
printf("\n");
the codes above will fail,but if I modify a litte like this:
int i;
#pragma omp parallel for
for(i= 0; i < 10; i++)
printf("%d ", i);
printf("\n");
the program will run correctly.
what'a more, when I use C++(modify the first codes as .cpp), the program can alse run normally.
why does this happen??