หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Expression following '#pragma omp atomic' has improper form
Remarks
An atomic directive was incorrectly specified.
Example
The following example generates C3048:
// C3048.cpp
// compile with: /openmp vcomps.lib
#include "omp.h"
#include <stdio.h>
int main() {
int a[10];
omp_set_num_threads(4);
#pragma omp parallel
{
#pragma omp atomic
a[0] = 1; // C3048
// try the following line instead
// a[0] += 1;
}
}