【发布时间】:2011-01-21 06:12:01
【问题描述】:
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。
【问题讨论】:
标签: c tcp unsigned bits bit-shift