A likely MSVC compiler bug on short C++ codes (about 20+ lines to reproduce). How to avoid it?
#include <iostream> // This win32 program gives wrong output: // when user inputs 1 to the program, it prints out 281474976710656 (2^48). but 0 is expected. // Reproduce Environment: // visual studio 2022 Platform Toolset v143 // Release Win32 // Optimization (default) (Maximum, Favor Speed) O2 // Language Standard c++14 (default) // some extra information: […]