unsigned char *adata = (unsigned char*)malloc(500*sizeof(unsigned char));
unsigned char *single_char = adata+100;
如何更改single_char中的前四位以表示1..10(int)之间的值?如何更改unsigned char中的4位?
问题来自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值,炭值是像0XA0。
在TCP报头的特定情况下,这八位字节的低4位被保留,必须为零。 – caf 2011-01-21 06:41:26
啊好吧,那么你的解决方案更好:) – GWW 2011-01-21 07:06:47