Click here to Skip to main content
15,917,709 members
Home / Discussions / C#
   

C#

 
GeneralRe: Selecting row Index of datagrid Pin
Marc Clifton18-May-05 4:17
mvaMarc Clifton18-May-05 4:17 
GeneralComboBox - remove focus Pin
NortonC18-May-05 2:05
NortonC18-May-05 2:05 
GeneralRe: ComboBox - remove focus Pin
Marc Clifton18-May-05 2:12
mvaMarc Clifton18-May-05 2:12 
GeneralRe: ComboBox - remove focus Pin
NortonC18-May-05 2:19
NortonC18-May-05 2:19 
GeneralProject Type in VS 2005 Pin
rathishps18-May-05 1:05
rathishps18-May-05 1:05 
GeneralGet High Byte of Int16 Pin
zuschauer198018-May-05 0:32
zuschauer198018-May-05 0:32 
GeneralRe: Get High Byte of Int16 Pin
Marc Clifton18-May-05 1:11
mvaMarc Clifton18-May-05 1:11 
GeneralRe: Get High Byte of Int16 Pin
S. Senthil Kumar18-May-05 1:21
S. Senthil Kumar18-May-05 1:21 
Do this
Int16 val = 0x010C;
byte highVal = (byte)((val >> 8) & 0x00FF);
byte lowVal = ((byte) val & 0x00FF);

You needn't worry about the endianness, as both 0x00FF and your variable will be stored the same way in memory. Even if it is stored as 0C 01 in memory, when your program issues a CPU instruction to read a 16 bit value, you'll get back 0x010C.

So whatever the endianness, in your program, 0x01 is the high byte and 0x0C is the low byte.

Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: Get High Byte of Int16 Pin
Mike Dimmick18-May-05 1:42
Mike Dimmick18-May-05 1:42 
Generaltwo's complement Pin
zuschauer198018-May-05 1:46
zuschauer198018-May-05 1:46 
GeneralRe: two's complement Pin
Sebastian Schneider18-May-05 3:50
Sebastian Schneider18-May-05 3:50 
GeneralRe: two's complement Pin
zuschauer198018-May-05 22:49
zuschauer198018-May-05 22:49 
GeneralCheckedListBoxes Pin
17-May-05 23:19
suss17-May-05 23:19 
GeneralRe: CheckedListBoxes Pin
Robert Rohde18-May-05 0:34
Robert Rohde18-May-05 0:34 
Generaldeleting particular node element from xml file Pin
ksanju100017-May-05 23:11
ksanju100017-May-05 23:11 
GeneralRe: deleting particular node element from xml file Pin
Gavin Jeffrey18-May-05 0:58
Gavin Jeffrey18-May-05 0:58 
Generalserializing an array of strings Pin
Green Fuze17-May-05 22:33
Green Fuze17-May-05 22:33 
GeneralRe: serializing an array of strings Pin
Christian Graus17-May-05 22:48
protectorChristian Graus17-May-05 22:48 
GeneralRe: serializing an array of strings Pin
Green Fuze17-May-05 23:14
Green Fuze17-May-05 23:14 
GeneralRe: serializing an array of strings Pin
jinzhecheng18-May-05 7:23
jinzhecheng18-May-05 7:23 
GeneralRe: serializing an array of strings Pin
Green Fuze19-May-05 3:15
Green Fuze19-May-05 3:15 
GeneralRe: serializing an array of strings Pin
jinzhecheng20-May-05 3:11
jinzhecheng20-May-05 3:11 
GeneralRe: serializing an array of strings Pin
Green Fuze20-May-05 6:01
Green Fuze20-May-05 6:01 
Generalcall a java class Pin
Mohammad Daba'an17-May-05 22:00
Mohammad Daba'an17-May-05 22:00 
GeneralRe: call a java class Pin
Christian Graus17-May-05 22:47
protectorChristian Graus17-May-05 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.