Concatenate hex numbers in C

跟風遠走 提交于 2019-12-04 07:15:23

Supposing unsigned int a,b,c,d;

unsigned int result = (a<<24) | (b<<16)| (c<<8) | d;

But this is essentially implementation dependent since C++ standard only specifies minimal sizes of integers.

So for uint32_t a, b, c, d:

uint32_t result = (a<<24) | (b<<16)| (c<<8) | d;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!