Open a big endian binary file containing integers 15, 3, 6, 9, 12. Create a union to read 4 bytes at a time from the file. Create an integer called FIRST_INT_READ and set it equal to the first integer read from the bytestream (which is 15). Read the bytestream two more times in a loop into the union. Try now to use FIRST_INT_READ as the stopping criteria in a nested for loop. FIRST_INT_READ now has a value of the third position in the bytestream which is integer 6, unless you cout FIRST_INT_READ inside the for loop. Workarounds include:1.) compiling in 32 bit mode2.) turning off optimization in 64 bit3.) declaring FIRST_INT_READ as volatile
Visual Studio/Team Foundation Server/.NET Framework Tooling version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results