Re: pointer conversion
- From: "Malcolm McLean" <regniztar@xxxxxxxxxxxxxx>
- Date: Fri, 31 Aug 2007 19:21:53 +0100
"Charlton Wilbur" <cwilbur@xxxxxxxxxxxxxx> wrote in message news:87abs7wu2c.fsf@xxxxxxxxxxxxxxxxxxxxxxxxx
Arrays have to be contiguous in memory. No padding bytes may be inserted between items."M" == Malcolm McLean <regniztar@xxxxxxxxxxxxxx> writes:
M> You will be OK. char is always 1 byte. So casting an arbitrary
M> pointer to a char *, adding an exact multiple of the size of
M> the original type, and casting back is guaranteed to preserve
M> alignment.
I am not so sure about that; would you care to cite C&V, please, if
you claim that it's guaranteed by the standard?
The rest follows from that.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
.
- Follow-Ups:
- Re: pointer conversion
- From: CBFalconer
- Re: pointer conversion
- References:
- pointer conversion
- From: junky_fellow@xxxxxxxxxxx
- Re: pointer conversion
- From: Malcolm McLean
- Re: pointer conversion
- From: Charlton Wilbur
- pointer conversion
- Prev by Date: Re: Porting C software
- Next by Date: Re: size_t problems
- Previous by thread: Re: pointer conversion
- Next by thread: Re: pointer conversion
- Index(es):
Relevant Pages
|