You can use the following functions to merge 2 words (16-bit) or 4 bytes (8-bit) into a 32-bit integer. There is also a function which makes a word (16-bit) using two bytes (8-bit). I am using the in my Qt/C++ projects whenever I need them but with a slight change you can use them on your non-Qt projects too.
Continue reading “How to make a 32-bit and 16-bit integers using 16-bit and 8-bit integers”