TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: SIMON AVERY
from: GEORGE WHITE
date: 1998-01-28 21:14:00
subject: CRC structs

Hi Simon,
Follow up:
GW>SA> SA>> How would I go about getting a CRC32 from a structure?
GW>SA> SA>> I /think/ I know how to do it with an array, but a structure is a
GW>SA> SA>> bunny of a different colour.
GW>SA> GW> Then turn it into a char array...
GW>SA>So simple?
GW>Yup :-).
GW>You could also do it by casting the struct to a char array...
I forgot to mention that there is just one "gotcha" in this where
structs are concerned. You need to ensure they are packed, and don't use
some default alignment which results in gaps between elements of the
struct.
George
 * SLMR 2.1a * All Trademarks acknowledged (just in case ).
--- Maximus/2 3.01
---------------
* Origin: DoNoR/2,Woking UK (44-1483-717905) (2:440/4)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.