I am using openmp and my program looks like as follows:
\#pragma omp parallel for
for(x = 0, y = 0, x < 5, x++, y++)
function(x, y, fp);
void function(int x , int y, FILE* fp);
{
fprintf(fp, "(%d, %d)\n", x y);
}
I want that the content of file as
(0, 0)
(2, 2)
(1, 1)
(3, 3)
(4, 4)
The ordering doesn't matter but the coordinates x, y should be in order, ie the program should not generate something like (2, 3). Is this behavior always guaranteed? I am using gcc compiler on linux.