unsigned char *adata = (unsigned char*)malloc(500*sizeof(unsigned char));
unsigned char *single_char = adata+100;
single_char의 처음 네 비트를 1..10 (int) 사이의 값으로 나타내려면 어떻게해야합니까? 부호없는 문자에서 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 같다.
에 사람을 도움이되기를 바랍니다 제로이어야합니다. – caf
아, 그럼 당신의 해결책은 더 좋습니다 :) – GWW
@GWW, 결국, 그것은 나를 위해 일한 당신의 해결책이었습니다. 그러나 때때로 이상한 값을 설정합니다. 예를 들어 single_char는 0x80 대신 16 진수 0x86이됩니다. –