c# - What does an integer look like when converted to a byte? -


i want create byte array in c# , first , second bytes have 70 , 75 respectively:

so did following:

list<byte> retval = new list<byte>();             retval.add(convert.tobyte(75));             retval.add(convert.tobyte(70)); 

i thought function convert numbers byte , if put watch on arraylist @ runtime, little different, did not change. expecting see values in format of 0x00 still looks raw integers.

am missing something?

right-click watch window or immediate window , check hexadecimal display option. default set "unchecked" bytes, because visual studio ide assumes prefer read int values instead of bytes:

enter image description here


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -