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