Suppose unsigned int a,b,c,d;
unsigned int result = (a<<24) | (b<<16)| (c<<8) | d;
But it mainly depends on the implementation, since the C ++ standard defines only the minimum sizes of integers.
So for uint32_t a, b, c, d :
uint32_t result = (a<<24) | (b<<16)| (c<<8) | d;
source share