I have an array of 32 elements of type 'unsigned char' (i.e. 32 bytes).
I'll like to store first 4 bytes of this array in a 'unsigned long', next 4 bytes in another 'unsigned long' and so on. Any ideas about how do I perform this?
I'm personally thinking that I need to do something like left shifting and then masking repeatedly but I don't get it right.
Another idea in my mind is to use uint32_t (C99) for this purpose. But I'm confused here too.
Any ideas?
I'll like to store first 4 bytes of this array in a 'unsigned long', next 4 bytes in another 'unsigned long' and so on. Any ideas about how do I perform this?
I'm personally thinking that I need to do something like left shifting and then masking repeatedly but I don't get it right.
Another idea in my mind is to use uint32_t (C99) for this purpose. But I'm confused here too.
Any ideas?
Comment