unsigned char *adata = (unsigned char*)malloc(500*sizeof(unsigned char));
unsigned char *single_char = adata+100;
How do I change first four bits in single_char to represent values between 1..10 (int)?
The question came from TCP header structure:
Data Offset: 4 bits
The number of 32 bit words in the TCP Header. This indicates where
the data begins. The TCP header (even one including options) is an
integral number of 32 bits long.
Usually it has value of 4..5, the char value is like 0xA0.