adding together two shorts
I have 2 32-bit unsigned long (DWORD) variables. the values that I am interested are contained in the low order shorts (WORD) of both of the variables. I would like to somehow and these 2 shorts together to form a long, since I know I am dealing with unsigned variables here I don't have to worry about sign bits or anything. I tried this:
Code:
return LOWORD(dwVer1) & LOWORD(dwVer2);
without any luck. when I try that I get the low order short/WORD in dwVer2 printed, but that is not what I am trying to achieve here. say for example the low order short/WORD in dwVer1 is 1, and the low order short/WORD in dwVer2 is 2, I am looking for the value 12 to be returned.
would anyone here please be able to help me out here? I obviously don't have much experience with bit manipulation in C, infact I think I will go back and review it again a few times. it's one of those boring topics that I probably went through too quickly, and now I'm regretting it.
any help is appreciated. thanks. :)