long a = 1; long b = 2; b = InterlockedExchange(&a, b);
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)