|
 |
Captain Jack wrote:
> That's true... I know the specification calls for packing the bytes as
> tightly as possible, but there's no standard spec for alignment.
I also believe (but I am too lazy to look it up right now) that it's
impossible to portably know whether
struct PackBits alpha = {0, 1, 0, 0};
struct PackBits beta = {0, 0, 0, 1};
alpha or beta will yield a larger number when cast to an int. I.e., I don't
think the standard even says whether the fields are allocated MSB or LSB first.
> I also used to make use of its "asm" keyword which would let me insert x86
> assembler code into the middle of my C code, and I'd often use that to
> squeeze some extra bits out of my memory usage.
Yep. When you really need to talk to the machine directly, C falls down.
That was the point of asking "why is C better?" It was only better for
portability compared to the other languages of the time.
--
Darren New, San Diego CA, USA (PST)
I ordered stamps from Zazzle that read "Place Stamp Here".
Post a reply to this message
|
 |