Hi
I have two 16bit numbers (in Hex):
0x1234
&&
0x2119
I would like to splice thease two numbers into a 64bit number like so:
0x1234000000002119
Can any one sugest a simple way to do this?
Thanks
Hi
I have two 16bit numbers (in Hex):
0x1234
&&
0x2119
I would like to splice thease two numbers into a 64bit number like so:
0x1234000000002119
Can any one sugest a simple way to do this?
Thanks
This seems to work:
Code:#include <stdio.h> int main(void) { unsigned short int a = 0x1234; unsigned short int b = 0x2119; unsigned long long c = (unsigned long long)a << 48 | b; printf("%I64x\n", c); /* for standard C: "%llx\n" return 0; }
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)