//This code result is 1.0f - 1.0f == 1753.0#include "stdafx.h" //empty#include <tchar.h>#include <iostream>#include <stdlib.h>struct Struct{float a;float b;};int _tmain(int argc, _TCHAR* argv[]){Struct* ptr = new Struct;float x;float y = rand() ? 1.0f : 2.0f;x = y + 1753;ptr->a = x;ptr->b = x - y;x = y;std::cout << "x = " << x << std::endl;std::cout << "y = " << y << std::endl;float result = x - y;std::cout << "x - y = " << result << std::endl;std::cin.get();delete ptr;return 0;}
Visual Studio/Team Foundation Server/.NET Framework Tooling version
Steps to reproduce
Product Language
Operating System
Operating System Language
Actual results
Expected results
Please wait...