- Code: Select all
void init(int *a, int *b) {
int r_a, r_b;
#pragma omp single copyprivate(x, y)
{
scanf("%d %d %d %d", &r_a, &r_b, &x, &y);
} /* end of omp single */
*a = r_a;
*b = r_b;
}
The Fortran example is ok, since a and b can be assigned new values within init() and those values can be seen by the calling function.
