Comparing two Hexadecimal values in C++ -
I want to have two hexadecimal (stored in the long run) my code is
Long continuous = 80040e14; If (continuously == 80040e14) COT & lt; & Lt; "Success" & lt; & Lt; Endl; And cout & lt; & Lt; "Fail !!" & Lt; & Lt; Endl;
This code flow always comes back to any other part in control, can anyone suggest how to compare.
Thanks
Santhosha K
Prefix with '0x'.
Your constant only 'e' will treat the number of compiler form and the number: NN Nei uses the '0x' prefix as a scientific notation to tell the compiler that the following characters are in hexadecimal notation.
In your code, 80040e14 is 8004000000000000000 which is too big to fit 32bit value, but may fit in 64 bit value. But, 80040e14 is a floating point number, so the comparison varies in the long run to float, making it continuous in the same type of form and hence due to the complications of the floating point code two values will be different.
Comments
Post a Comment