sizeof() returns the total storage bytes of the struct including padded bytes for alignment. It is returning 24 because of a
byte that was added for alignment.
The format of your structure looks fine except payloadID, TTL, Hops, and payloadlen should probably be unsigned.
Last edited by tshdos; April 24th, 2002 at 05:21 PM.
|