porting C code

Peter Hansen peter at engcorp.com
Thu Jan 13 20:16:04 EST 2005


Lucas Raab wrote:
> I have the 
> statement: "typedef   unsigned long int  word32" and later on: "word32 
> b[3]" referencing the third bit of the integer. 

If that's really exactly what you have, then you actually have
something defining an array of three unsigned long integers
named "b".  And even if you didn't have precisely "word32 b[3]",
but merely a "b[3]" reference somewhere, it would be referencing
the third element of an array called "b", which is possibly a byte,
maybe a long, but definitely not a bit.

Maybe showing it as code rather than inline in your text
would avoid the possibility of confusion.

-Peter



More information about the Python-list mailing list