Re: Questions about alignment
- From: "Purshotam" <purshotam.roy@xxxxxxxxx>
- Date: Thu, 28 Jul 2005 06:47:17 -0000
Spiros Bousbouras wrote:
> Greetings
>
> A couple of questions:
>
> 1) If the address d is suitably aligned for datatype A then is it
> guaranteed that d+sizeof(A) will also be suitably aligned for A ?
>
> 2) If p is a pointer to some datatype B and contains a properly aligned
> address for B then does p+1 point to the next properly aligned address
> for B ?
Well, what you are doing is pretty much just the incrementation of the
pointer. Though I might add that it is not necessary for d or p to be
suitably aligned. The result is expected to be similar to that of
incrementation[++ or +=1] irrespective of the the address being aligned
or not.
--
comp.lang.c.moderated - moderation address: clcm@xxxxxxxxxxxx -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
.
- References:
- Questions about alignment
- From: Spiros Bousbouras
- Questions about alignment
- Prev by Date: Re: strcat not working
- Next by Date: Re: data representation / structure initialization query
- Previous by thread: Re: Questions about alignment
- Next by thread: Re: Questions about alignment
- Index(es):
Relevant Pages
|