How to convert a byte array to word array in C?
const byte input[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};unsigned long output[sizeof(input) / sizeof(unsigned long)];
memcpy(output, input, sizeof(input));
Word to byte:
unsigned char bytes[sizeof(int)];
intn = 123;
*(int *)bytes = n;
Comments