title | ms.custom | ms.date | ms.reviewer | ms.suite | ms.technology | ms.tgt_pltfrm | ms.topic | dev_langs | ms.assetid | caps.latest.revision | author | ms.author | manager | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A.21 Scoping Variables with the private Clause | Microsoft Docs |
11/04/2016 |
|
article |
|
7cdb4a7f-af24-44ac-9d33-e43840bc8f3d |
7 |
mikeblome |
mblome |
ghogen |
The values of i
and j
in the following example are undefined on exit from the parallel region:
int i, j;
i = 1;
j = 2;
#pragma omp parallel private(i) firstprivate(j)
{
i = 3;
j = j + 2;
}
printf_s("%d %d\n", i, j);
For more information on the private
clause, see Section 2.7.2.1 on page 25.