unsigned char *adata = (unsigned char*)malloc(500*sizeof(unsigned char));
unsigned char *single_char = adata+100;
如何更改 single_char 中的前四位以表示 1..10 (int) 之间的值?
问题来自 TCP 标头结构:
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.
通常它的值为 4..5,char 值类似于 0xA0。