I am working with hex values. Until now I know how to print hex values and also precision thing. Now I want to compare the hex values. For example I am reading data from a file into a char buffer. Now I want to compare the hex value of data in the buffer. Is there anything like this?
if hex(buffer[i]) > 0X3F
then
//do somthing
How can I do this?
You’re nearly there:
Note that there is no need to “convert” anything to hex – you can just compare character or integer values directly, since a hex constant such as 0x3f is just another way of representing an integer value. 0x3f == 63 (decimal) == ASCII ‘?’.