Should work . . .
I used your code and wrote it in the following way both gave correct outputs for me.
#include <iostream>
int
main(
void)
{
// 8-bit values
char a = 0x56;
char b = 0x78;
char c = 0x9A;
char d = 0xBC;
// combine into a single 32-bit value
unsigned int value = d | (c<<8) | (b<<16) | (a<<24);
std::cout << std::hex << value << std::endl;
}
output is:
0x5678ABC
Compiled in both x64 and x86, result is the same.
--
What output are you getting?