What it the preferred method to write a class to a file?
Jarrett Billingsley
kb3ctd2 at yahoo.com
Sun Jul 23 16:28:49 PDT 2006
"Charles D Hixson" <charleshixsn at earthlink.net> wrote in message
news:ea0rll$5h9$1 at digitaldaemon.com...
> P.S.: Is there a standard library routine for converting
> between strings of length 4 and uint-s? If so I wasn't able
> to find it. If not, I wasn't able to determine that it
> didn't exist. (That would have made writing the sig more
> efficient.)
You don't even need a routine to do it.
char[] sig = "help";
uint s = *cast(uint*)sig.ptr;
And the other way..
uint s = 0xAABBCCDD;
char[] sig = new char[4];
*cast(uint*)sig.ptr = s;
More information about the Digitalmars-d-learn
mailing list