This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

mixed vartype buffer in C

I would like to work on a simple communication buffer array abBuf[6][7], that contains all kind of data (8 and 16bit and string) directly without type conversions etc.

Example: I have a 16byte variable X stored at abBuf[3][1] and abBuf[3][2]. The order (big endian) corresponds to a normal unsigned int variable. Is there a sort of elegant typecast or definition in C possible that would allow me to printf(%u,???) or use its value as 16bit variable in a formula etc besides the definition of a big union?

Werner

0