+ 1

How to compare two hex values?

What i want to do is to check the elements of array which are bytes are greater or less than some hex value? so i'm trying write like this -> bytes[] chars = new bytes[] {some hex values}; foreach(byte b in chars){ if(b> hex value && b< hex halue) ---> some code }

6th Aug 2017, 3:26 AM
Nursultan Esirkegenov
Nursultan Esirkegenov - avatar
1 Antwort
+ 1
if the values are both in hex-format. They can be compared using standard operators ? Do they ? int x = 0x1A2F; int y = 0x1A2E; if (x > y) { Console.WriteLine("x greater than y"); } else { Console.WriteLine("x smaller than y"); } https://code.sololearn.com/cQGOQSxTSzHT
6th Aug 2017, 9:04 PM
sneeze
sneeze - avatar