Conversion of byte array containing hex values to decimal values

前端 未结 5 1987
一生所求
一生所求 2021-01-01 04:17

I am making application in c#.Here i want to convert a byte array containing hex values to decimal values.Suppose i have one byte array as

array[0]=0X4E;
ar         


        
5条回答
  •  醉梦人生
    2021-01-01 05:15

    hex and decimal are just different ways to represent the same data you want something like

    int myInt = array[0] | (array[1] << 8) | (array[2] << 16) | (array[3] <<24)
    

提交回复
热议问题