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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -