I am reading data back from a microcontroller using modbus. I need to join two words together to make a dword.
I have both word values stored in variables in C, as below:
var1 = 15
var2 = 25
I need to join them so var3 has the value 1525
I also need to be able to split them back up into 2 words.
Are there standard C functions for performing these operations? cast 2 words to a dword?