When I try to execute this code in VS 2013 / Win64 / Release, I get the wrong result: it prints 1 1.
In Visual Win32 / Debug / Release and Win64 / Debug, the result is correct.
A Visual Studio project was created with default settings.
#include <iostream>
int main(int argc, char* argv[])
{
long long inc[2] = { 0, 1 };
long long dinc[2] = { 0, 0 };
dinc[0] = inc[1] - inc[0];
dinc[1] = inc[0] - inc[1];
for (int i = 0; i < 2; ++i)
std::cout << i << "\t" << dinc[i] << "\n";
return 0;
}
How to explain this result?
source
share