Skip to content

Latest commit

 

History

History
32 lines (30 loc) · 802 Bytes

a-21-scoping-variables-with-the-private-clause.md

File metadata and controls

32 lines (30 loc) · 802 Bytes
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
cpp-windows
article
C++
7cdb4a7f-af24-44ac-9d33-e43840bc8f3d
7
mikeblome
mblome
ghogen

A.21 Scoping Variables with the private Clause

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.