Assuming that unsigned long long
is a 64-bit type on your platform
assert(sizeof(unsigned long) * CHAR_BIT == 32);
assert(sizeof(unsigned long long) * CHAR_BIT == 64);
// Static asserts are more appropriate in cases like this
unsigned long long Timestamp = TimestampHi;
Timestamp <<= 32; Timestamp += TimestampLo;
And then print the Timestamp
value.
Same thing as an one-liner
unsigned long long Timestamp = ((unsigned long long) TimestampHi << 32) + TimestampLo;
or simply
printf("%llu\n", ((unsigned long long) TimestampHi << 32) + TimestampLo);
If you wish to abstract your code from bit-based operations, the expression can be rewritten as
TimestampHi * ((unsigned long long) ULONG_MAX + 1) + TimestampLo