I want to generate sequence of hexadecimal numbers starting with 07060504003020100. Next number would be 0f0e0d0c0b0a0908 etc in that order. When i use unsigned long long int and output the data first 4 ...
How can i convert a char array of number to byte array? Example:
char *digit="3224833640520308023"//long long array
uint8_t buff[256]= {0x2c, 0xc0, 0xe9, 0x1c, 0x32, 0xf1, 0x55, 0x37, 0}; (2c c0 e9 1c 32 ...
#include #include int main() { unsigned short int bob; unsigned char header[200]; header[15] = 10; header[16] = 9; printf("header[15]= %d header[16] = %d\n",header[15],header[16]); bob = htons(header[15]); /* MSB */ bob = bob | (0xFFFF & htons(header[16])) >> 8; /* LSB */ printf ("bob: HEX = 0x%4X DEC = %d\n", bob,bob); return 0; }